468,283 Members | 1,945 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,283 developers. It's quick & easy.

python doc in command line

Hi,

Perl has a command line help perldoc. I'm wondering if python has a
similar help command.

Thanks,
Peng
Jul 16 '08 #1
2 1327
Peng Yu wrote:
Perl has a command line help perldoc. I'm wondering if python has a
similar help command.
it's built into the interpreter, and Python tells you how to use it when
you start Python in interactive mode.

$ python
Python 2.5.1
Type "help", "copyright", "credits" or "license" for more information.
>>help
Type help() for interactive help, or help(object) for help about object.
>>help()
Welcome to Python 2.5! This is the online help utility.

If this is your first time using Python, you should definitely check out
the tutorial on the Internet at http://www.python.org/doc/tut/.

Enter the name of any module, keyword, or topic to get help on writing
Python programs and using Python modules. To quit this help utility and
return to the interpreter, just type "quit".

To get a list of available modules, keywords, or topics, type "modules",
"keywords", or "topics". Each module also comes with a one-line summary
of what it does; to list the modules whose summaries contain a given
word such as "spam", type "modules spam".

helpquit

You are now leaving help and returning to the Python interpreter.
If you want to ask for help on a particular object directly from the
interpreter, you can type "help(object)". Executing "help('string')"
has the same effect as typing a particular string at the helpprompt.
>>help("string")
Help on module string:

NAME
string - A collection of string operations (most are no
longer used).

FILE
string.py

....
>>help(len)
Help on built-in function len in module __builtin__:

len(...)
len(object) -integer

Return the number of items of a sequence or mapping.
>>>
(etc)

</F>

Jul 16 '08 #2
Peng Yu <Pe*******@gmail.comwrites:
Perl has a command line help perldoc. I'm wondering if python has a
similar help command.
The interactive interpreter has a "help" command, and a corresponding
"help" function which can be passed an object to display its
docstrings recursively and nicely-formatted.

The same facility is available with the external 'pydoc' command.

--
\ “The right to search for truth implies also a duty; one must |
`\ not conceal any part of what one has recognized to be true.” |
_o__) —Albert Einstein |
Ben Finney
Jul 16 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Adam | last post: by
52 posts views Thread by Olivier Scalbert | last post: by
reply views Thread by Fuzzyman | last post: by
1 post views Thread by jtan325 | last post: by
4 posts views Thread by tnoell | last post: by
18 posts views Thread by stylecomputers | last post: by
reply views Thread by Martijn de Munnik | last post: by
reply views Thread by Cameron Simpson | last post: by
2 posts views Thread by MrBee | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.