Staging
v0.5.1
https://github.com/python/cpython
Revision 521cbc37af8912781d58336c8bb1fd523b91c421 authored by Phillip J. Eby on 23 September 2004, 05:19:27 UTC, committed by Phillip J. Eby on 23 September 2004, 05:19:27 UTC
1 parent 6b154df
Raw File
Tip revision: 521cbc37af8912781d58336c8bb1fd523b91c421 authored by Phillip J. Eby on 23 September 2004, 05:19:27 UTC
Fix for SF bug #1029475 : reload() doesn't work with PEP 302 loaders.
Tip revision: 521cbc3
libmain.tex
\section{\module{__main__} ---
         Top-level script environment}

\declaremodule[main]{builtin}{__main__}
\modulesynopsis{The environment where the top-level script is run.}

This module represents the (otherwise anonymous) scope in which the
interpreter's main program executes --- commands read either from
standard input, from a script file, or from an interactive prompt.  It
is this environment in which the idiomatic ``conditional script''
stanza causes a script to run:

\begin{verbatim}
if __name__ == "__main__":
    main()
\end{verbatim}
back to top