From d1392f83e5d742f43e6868c609ebd52e91d872df Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Fri, 27 Sep 2019 09:16:42 -0400 Subject: [PATCH] Small touchup for readme (#469) * Small touchup for readme * Adding note about local.cmd * Make local.cmd.ls the default --- README.rst | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/README.rst b/README.rst index f6cf26647..e93eb60b9 100644 --- a/README.rst +++ b/README.rst @@ -54,23 +54,16 @@ Basics .. code-block:: python >>> from plumbum import local - >>> ls = local["ls"] - >>> ls + >>> local.cmd.ls LocalCommand() - >>> ls() + >>> local.cmd.ls() u'build.py\ndist\ndocs\nLICENSE\nplumbum\nREADME.rst\nsetup.py\ntests\ntodo.txt\n' >>> notepad = local["c:\\windows\\notepad.exe"] >>> notepad() # Notepad window pops up u'' # Notepad window is closed by user, command returns -Instead of writing ``xxx = local["xxx"]`` for every program you wish to use, you can -also ``import`` commands - -.. code-block:: python - - >>> from plumbum.cmd import grep, wc, cat, head - >>> grep - LocalCommand() +In the example above, you can use ``local["ls"]`` if you have an unusually named executable or a full path to an executable. The `local` object represents your local machine. As you'll see, Plumbum also provides remote machines that use the same API! +You can also use ``from plumbum.cmd import ls`` as well for accessing programs in the ``PATH``. Piping ******