[Python-checkins] CVS: python/dist/src/Lib pydoc.py,NONE,1.1

Ka-Ping Yee ping@users.sourceforge.net
Tue, 27 Feb 2001 06:43:48 -0800


Update of /cvsroot/python/python/dist/src/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv12686

Added Files:
	pydoc.py 
Log Message:
pydoc: text and HTML documentation generator for interactive use


--- NEW FILE: pydoc.py ---
#!/usr/bin/env python
"""Generate Python documentation in HTML or as text for interactive use.

At the shell command line outside of Python, run "pydoc <name>" to show
documentation on something.  <name> may be the name of a Python function,
module, package, or a dotted reference to a class or function within a
module or module in a package.  Alternatively, the argument can be the
path to a Python source file.

Or, at the shell prompt, run "pydoc -k <keyword>" to search for a keyword
in the one-line descriptions of modules.

Or, at the shell prompt, run "pydoc -p <port>" to start an HTTP server
on a given port on the local machine to generate documentation web pages.

Or, at the shell prompt, run "pydoc -w <name>" to write out the HTML
documentation for a module to a file named "<name>.html".

In the Python interpreter, do "from pydoc import help" to provide online
[...1119 lines suppressed...]
    except (getopt.error, BadUsage):
        print """%s <name> ...
    Show documentation on something.
    <name> may be the name of a Python function, module, or package,
    or a dotted reference to a class or function within a module or
    module in a package, or the filename of a Python module to import.

%s -k <keyword>
    Search for a keyword in the synopsis lines of all modules.

%s -p <port>
    Start an HTTP server on the given port on the local machine.

%s -w <module> ...
    Write out the HTML documentation for a module to a file.

%s -w <moduledir>
    Write out the HTML documentation for all modules in the tree
    under a given directory to files in the current directory.
""" % ((sys.argv[0],) * 5)