Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does the Pydoc module do?

New to programming and python altogether. In the book I'm learning from, the author suggested I find out the purpose of Pydoc.

I did a google search on it, and found a match (from Gnome Terminal) but it didn't make much sense to me. Anyone mind simplifying a bit?

like image 251
logan beaupre Avatar asked Feb 06 '14 00:02

logan beaupre


People also ask

How do I run pydoc in terminal?

You can access the interactive shell in pydoc using it's help function. In order to do this, launch your terminal, and enter the python interactive shell. Now, import pydoc and then use the pydoc. help() command to launch the interactive shell.

How do I install pydoc modules?

Linux & WindowsType install and select the menu item, Package Control: Install Package . Type PyDOC and select the PyDOC package that is displayed. This will install the package in your editor.

How do I view documents in Python?

Python has a built-in help() function that can access this information and prints the results. For example, to see the documentation of the built-in len function, you can do the following: In [1]: help(len) Help on built-in function len in module builtins: len(...)


2 Answers

Pydoc is a help / documentation module for Python.

Use this on your Windows terminal to understand what a function in python does :

python -m pydoc <function>

eg.

python -m pydoc raw_input

If the documentation for a particular function is very long, use 'q' to get out of it.

e.g. in case of

python -m pydoc Tkinter
like image 144
Kapil Marwaha Avatar answered Oct 23 '22 18:10

Kapil Marwaha


It's a tool to generate python-style documentation see http://docs.python.org/2/library/pydoc.html

You may want to take a look at Sphinx too.

like image 33
Eric B. Avatar answered Oct 23 '22 18:10

Eric B.