Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Updated README.rst.
  • Loading branch information
mbr committed Apr 25, 2015
1 parent 04bfc8e commit 6e31462
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions README.rst
Expand Up @@ -3,6 +3,21 @@ A copy & paste backport of Python 3.3's ``shutil.which`` function.
Usage
=====

* Install this package: ``pip install shutilwhich``
* Import like this: ``import shutilwhich``. This will monkeypatch ``shutil``
if there is no ``shutil.which`` method, otherwise leave it alone.
First, install the package: ``pip install shutilwhich``

Importing the package::

import shutilwhich

will monkey-patch the ``shutil`` package, so from that point on you can simply
import the ``which`` function::

from shutil import which

To keep things a little more concise, you can also import ``which`` directly
from ``shutilwhich``::

from shutilwhich import which

This will still monkeypatch the ``shutil`` module. On Python 3.3 and above, the
module never do anything but return the stdlib ``shutil.which`` function.

0 comments on commit 6e31462

Please sign in to comment.