annotate Doc/lib/libmain.tex @ 21467:4e35fa5d5708 legacy-trunk

Add documentation for the help() built-in; contributed by Ka-Ping Yee. This is part of SF patch #494622.
author Fred Drake <fdrake@acm.org>
date Tue, 18 Dec 2001 16:31:08 +0000
parents 79bf6b38b7d5
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8918
acfffe14628e New section header style.
Fred Drake <fdrake@acm.org>
parents: 8716
diff changeset
1 \section{\module{__main__} ---
14035
79bf6b38b7d5 A little more text, and some really minor cleanups.
Fred Drake <fdrake@acm.org>
parents: 8918
diff changeset
2 Top-level script environment}
79bf6b38b7d5 A little more text, and some really minor cleanups.
Fred Drake <fdrake@acm.org>
parents: 8918
diff changeset
3
8716
760dcf197048 Adjusted to use the new module synopsis support macros.
Fred Drake <fdrake@acm.org>
parents: 7877
diff changeset
4 \declaremodule[main]{builtin}{__main__}
760dcf197048 Adjusted to use the new module synopsis support macros.
Fred Drake <fdrake@acm.org>
parents: 7877
diff changeset
5 \modulesynopsis{The environment where the top-level script is run.}
760dcf197048 Adjusted to use the new module synopsis support macros.
Fred Drake <fdrake@acm.org>
parents: 7877
diff changeset
6
1471
2ec96140a36b Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff changeset
7 This module represents the (otherwise anonymous) scope in which the
2ec96140a36b Restructured library documentation
Guido van Rossum <guido@python.org>
parents:
diff changeset
8 interpreter's main program executes --- commands read either from
14035
79bf6b38b7d5 A little more text, and some really minor cleanups.
Fred Drake <fdrake@acm.org>
parents: 8918
diff changeset
9 standard input, from a script file, or from an interactive prompt. It
79bf6b38b7d5 A little more text, and some really minor cleanups.
Fred Drake <fdrake@acm.org>
parents: 8918
diff changeset
10 is this environment in which the idiomatic ``conditional script''
79bf6b38b7d5 A little more text, and some really minor cleanups.
Fred Drake <fdrake@acm.org>
parents: 8918
diff changeset
11 stanza causes a script to run:
79bf6b38b7d5 A little more text, and some really minor cleanups.
Fred Drake <fdrake@acm.org>
parents: 8918
diff changeset
12
79bf6b38b7d5 A little more text, and some really minor cleanups.
Fred Drake <fdrake@acm.org>
parents: 8918
diff changeset
13 \begin{verbatim}
79bf6b38b7d5 A little more text, and some really minor cleanups.
Fred Drake <fdrake@acm.org>
parents: 8918
diff changeset
14 if __name__ == "__main__":
79bf6b38b7d5 A little more text, and some really minor cleanups.
Fred Drake <fdrake@acm.org>
parents: 8918
diff changeset
15 main()
79bf6b38b7d5 A little more text, and some really minor cleanups.
Fred Drake <fdrake@acm.org>
parents: 8918
diff changeset
16 \end{verbatim}