rest25/library/pydoc.rst => rest262/library/pydoc.rst
31style similar to the manual pages shown by the Unix :program:`man` command.  The
32argument to :program:`pydoc` can be the name of a function, module, or package,
33or a dotted reference to a class, method, or function within a module or module
34in a package.  If the argument to :program:`pydoc` looks like a path (that is,
35it contains the path separator for your operating system, such as a slash in
36Unix), and refers to an existing Python source file, then documentation is
37produced for that file.
38
n39+.. note::
40+ 
41+   In order to find objects and their documentation, :mod:`pydoc` imports the
42+   module(s) to be documented.  Therefore, any code on module level will be
43+   executed on that occasion.  Use an ``if __name__ == '__main__':`` guard to
44+   only execute code when a file is invoked as a script and not just imported.
45+ 
39Specifying a :option:`-w` flag before the argument will cause HTML documentation
40to be written out to a file in the current directory, instead of displaying text
41on the console.
42
43Specifying a :option:`-k` flag before the argument will search the synopsis
44lines of all available modules for the keyword given as the argument, again in a
45manner similar to the Unix :program:`man` command.  The synopsis line of a
46module is the first line of its documentation string.
54documentation pages.
55
56When :program:`pydoc` generates documentation, it uses the current environment
57and path to locate modules.  Thus, invoking :program:`pydoc` :option:`spam`
58documents precisely the version of the module you would get if you started the
59Python interpreter and typed ``import spam``.
60
61Module docs for core modules are assumed to reside in
t62-`<http://www.python.org/doc/current/lib/>`_.  This can be overridden by setting
t69+http://docs.python.org/library/.  This can be overridden by setting the
63-the :envvar:`PYTHONDOCS` environment variable to a different URL or to a local
70+:envvar:`PYTHONDOCS` environment variable to a different URL or to a local
64directory containing the Library Reference Manual pages.
65
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op