source: vendor/python/2.5/Doc/lib/libmain.tex

Last change on this file was 3225, checked in by bird, 18 years ago

Python 2.5

File size: 553 bytes
Line 
1\section{\module{__main__} ---
2 Top-level script environment}
3
4\declaremodule[main]{builtin}{__main__}
5\modulesynopsis{The environment where the top-level script is run.}
6
7This module represents the (otherwise anonymous) scope in which the
8interpreter's main program executes --- commands read either from
9standard input, from a script file, or from an interactive prompt. It
10is this environment in which the idiomatic ``conditional script''
11stanza causes a script to run:
12
13\begin{verbatim}
14if __name__ == "__main__":
15 main()
16\end{verbatim}
Note: See TracBrowser for help on using the repository browser.