[Tutor] How to use pydoc
Lie Ryan
lie.1296 at gmail.com
Sat Feb 27 14:29:11 CET 2010
On 02/27/10 00:31, Ricardo Aráoz wrote:
> Checked the manuals on pydoc and wanted to try it. Must certainly be
> doing something wrong but I can't figure what. Here's my session :
The pydoc command works from your system shell (e.g. bash), not python
shell; if you want to get help inside python's shell, use the help()
built-in function.
$ pydoc itertools
# showing itertools's doc on your default pager (usually `less`) #
$ python
Python 2.6.4 (r264:75706, Jan 12 2010, 05:24:27)
[GCC 4.3.4] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> help('itertools')
# showing itertools's doc on your default pager (usually `less`) #
>>> # you need to pass the module's name as a string to help()
>>> # either that, or import the module first:
>>> import itertools
>>> help(itertools)
# showing itertools's doc on your default pager (usually `less`) #
>>>
More information about the Tutor
mailing list