seeing documentation

Werner Schiendl ws-news at gmx.at
Tue Dec 18 15:15:25 EST 2001


Hi Sarcar,

If you are able to import the module, you can list its contents with dir, e.
g. (i used sys, 'cause I don't have parted)

>>> import sys
>>> dir(sys)
['__displayhook__', '__doc__', ... snipped lots more ..., 'warnoptions',
'winver']

And you can output the docstrings of the module, e. g.

>>> print sys.__doc__
This module provides access to some objects used or maintained by the
interpreter and to functions that interact strongly with the interpreter.

Dynamic objects:

argv -- command line arguments; argv[0] is the script pathname if known
path -- module search path; path[0] is the script directory, else ''
... snipped ...

and it's elements, e. g.

>>> print sys.exit.__doc__
exit([status])

Exit the interpreter by raising SystemExit(status).
If the status is omitted or None, it defaults to zero (i.e., success).
If the status numeric, it will be used as the system exit status.
If it is another kind of object, it will be printed and the system
exit status will be one (i.e., failure).


hth
Werner

"Sarcar, Shourya C (MED)" <Shourya.Sarcar at med.ge.com> wrote in message
news:mailman.1008694342.24749.python-list at python.org...
> i am trying to figure out the interfaces for GNU parted from python
> I am not able to get hold on any documentation. is it possible to get
> documentation out when i am able to do "import parted"
> i think i have a lib for parted in /usr/lib/python but not the source
> code.
>
> thanks in advance
>





More information about the Python-list mailing list