rest25/library/runpy.rst => rest262/library/runpy.rst
n1- 
2-:mod:`runpy` --- Locating and executing Python modules.
1+:mod:`runpy` --- Locating and executing Python modules
3-=======================================================
2+======================================================
4
5.. module:: runpy
n5+   :synopsis: Locate and run Python modules without importing them first.
6.. moduleauthor:: Nick Coghlan <ncoghlan@gmail.com>
n7- 
8- 
9-.. % standard library, in Python
10- 
11
12
13.. versionadded:: 2.5
14
15The :mod:`runpy` module is used to locate and run Python modules without
16importing them first. Its main use is to implement the :option:`-m` command line
17switch that allows scripts to be located using the Python module namespace
18rather than the filesystem.
52   does not make filename information available, this variable is set to ``None``.
53
54   ``__builtins__`` is automatically initialised with a reference to the top level
55   namespace of the :mod:`__builtin__` module.
56
57   If the argument *alter_sys* is supplied and evaluates to ``True``, then
58   ``sys.argv[0]`` is updated with the value of ``__file__`` and
59   ``sys.modules[__name__]`` is updated with a temporary module object for the
t60-   module being executed. Both ``sys.argv[0]`` and ``sys.modules[__name__]`` are
t56+   module being executed. Both ``sys.argv[0]`` and ``sys.modules[__name__]``
61-   restored to their original values before the function returns.
57+   are restored to their original values before the function returns.
62
63   Note that this manipulation of :mod:`sys` is not thread-safe. Other threads may
64   see the partially initialised module, as well as the altered list of arguments.
65   It is recommended that the :mod:`sys` module be left alone when invoking this
66   function from threaded code.
67
68
69.. seealso::
Legends
Colors
 Added 
Changed
Deleted
Links
(f)irst change
(n)ext change
(t)op