Skip to content

Commit

Permalink
Small touchup for readme
Browse files Browse the repository at this point in the history
  • Loading branch information
henryiii committed Sep 23, 2019
1 parent 86363a1 commit 00cd55b
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -53,24 +53,18 @@ Basics

.. code-block:: python
>>> from plumbum import local
>>> ls = local["ls"]
>>> from plumbum.cmd import ls
>>> ls
LocalCommand(<LocalPath /bin/ls>)
>>> ls()
u'build.py\ndist\ndocs\nLICENSE\nplumbum\nREADME.rst\nsetup.py\ntests\ntodo.txt\n'
>>> from plumbum import local
>>> 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(<LocalPath /bin/grep>)
In the example above, `ls = local["ls"]` is also valid and looks in your PATH; the `local` object represents your local machine.
The `plumbum.cmd` is a useful shortcut for accessing programs in the PATH.

Piping
******
Expand Down

0 comments on commit 00cd55b

Please sign in to comment.