Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install pywhereis

How to install pywhereis

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install pywhereis
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
0.0.2 Available View build log
0.0.1 Available View build log
0.0.2 Available View build log
0.0.1 Available View build log
Windows (64-bit)
0.0.2 Available View build log
0.0.1 Available View build log
0.0.2 Available View build log
0.0.1 Available View build log
Mac OS X (10.5+)
0.0.2 Available View build log
0.0.1 Available View build log
0.0.2 Available View build log
0.0.1 Available View build log
Linux (32-bit)
0.0.2 Available View build log
0.0.1 Available View build log
0.0.2 Available View build log
0.0.1 Available View build log
Linux (64-bit)
0.0.2 Available View build log
0.0.1 Available View build log
0.0.2 Available View build log
0.0.1 Available View build log
0.0.2 Available View build log
 
License
BSD license
Imports
Lastest release
version 0.0.2 on Oct 31st, 2011

Summary

Locate a python object (package, module, function, class ...) source file.

Usage

pywhereis [-v] [-s] dotted_name...

CMD line Examples

  • The pywhereis script accept a package, module, function or a class

    $ pywhereis shlex
    shlex: /usr/lib/python2.6/shlex.py
    $ pywhereis os.path.abspath
    os.path.abspath: /usr/lib/python2.6/posixpath.py  337
    
  • You can pass more than one dotted-name to it

    $ pywhereis shlex inspect.ismodule
    shlex: /usr/lib/python2.6/shlex.py
    inspect.ismodule: /usr/lib/python2.6/inspect.py  51
    
  • If the name is a function, class or method the result will contain the line number where the object is defined

    $ pywhereis unittest.TestCase.assertEqual
    unittest.TestCase.assertEqual: /usr/lib/python2.6/unittest.py  344
    
  • It will fail localizing object that are not pure python

    $ pywhereis.py sys
    sys:
    
  • For more info about why the localization fail you can use the verbose mode

    $ pywhereis -v sys
    sys: Error: <module 'sys' (built-in)> is built-in.
    
  • If it's run with -s, --site-packages option the script will check first in site-packages instead of the default which is to check in the current dir first

    $ cd ~ ; touch os.py
    $ pywhereis os
    os: /home/mouad/os.py
    $ pywhereis -s os
    os: /usr/lib/python2.6/os.py
    
  • Of course you can search in a different python version by running this script using that version

    $ python3.2 /path/to/pywhereis html
    html: /usr/local/lib/python3.2/html/__init__.py
    
  • For python2.7 and above you can also do

    $ python2.7 -mwhereis subprocess.Popen
    subprocess.Popen: /usr/local/lib/python2.7/subprocess.py 33
    

Code Examples

This package come also with a python package whereis that can be used like so

>>> import whereis
>>> whereis.resolve('sys')
<module 'sys' (built-in)>
>>> whereis.locate('os')
'/usr/lib/python2.6/os.py'

Subscribe to package updates

Last updated Oct 31st, 2011

Download Stats

Last month:1

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.