Updated for 2.1a3
[python/dscho.git] / Doc / lib / libmain.tex
blob00c7426fbae5e98b548e338bef801dbfab7782ca
1 \section{\module{__main__} ---
2 Top-level script environment}
4 \declaremodule[main]{builtin}{__main__}
5 \modulesynopsis{The environment where the top-level script is run.}
7 This module represents the (otherwise anonymous) scope in which the
8 interpreter's main program executes --- commands read either from
9 standard input, from a script file, or from an interactive prompt. It
10 is this environment in which the idiomatic ``conditional script''
11 stanza causes a script to run:
13 \begin{verbatim}
14 if __name__ == "__main__":
15 main()
16 \end{verbatim}