Using pydoc

Fernando Perez fperez528 at yahoo.com
Mon Feb 11 00:35:39 EST 2002


> Calls seem to be made like:
>
>         drvobj = partition.Partition(drv)
>         drvobj.create_partition_table()
>         drvobj.commit_changes()
>
> My question is:  How do I find documentation for those things?
>
>     ~$ pydoc partition.Partition
>         no Python documentation found for 'partition.Partition'

<blatant plug for my pet project follows>

In [1]: import os

In [2]: os.path?
Type:           module
Base Class:     <type 'module'>
String Form:    <module 'ntpath' from 'C:\Program
Files\Python22\lib\ntpath.pyc'
>
Namespace:      Currently not defined in user session.
File:           c:\program files\python22\lib\ntpath.py
Docstring:
    Common pathname manipulations, WindowsNT/95 version.

    Instead of importing this module directly, import os and refer to this
    module as os.path.

The above is a copy/paste of an IPython session. It's actually a Linux
project originally, but right now I happen to be cleaning up a Windows port.
With object? IPython will give you all sorts of details about any object it
can access (uses pydoc internally).

You can get it at

http://www-hep.colorado.edu/~fperez/ipython/

</blatant plug>

Cheers,

f.






More information about the Python-list mailing list