By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
457,877 Members | 1,077 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 457,877 IT Pros & Developers. It's quick & easy.

python doc in command line

P: n/a
Hi,

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

Thanks,
Peng
Jul 16 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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

P: n/a
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.