• Home
  • Raw
  • Download

Lines Matching +full:before +full:- +full:script

1 :mod:`runpy` --- Locating and executing Python modules
11 --------------
14 importing them first. Its main use is to implement the :option:`-m` command
18 Note that this is *not* a sandbox module - all code is executed in the
46 The optional dictionary argument *init_globals* may be used to pre-populate
47 the module's globals dictionary before the code is executed. The supplied
54 dictionary before the module code is executed (Note that this is a
55 minimal set of variables - other variables may be set implicitly as an
67 :ref:`set as normal <import-mod-attrs>` based on the module spec.
73 are restored to their original values before the function returns.
75 Note that this manipulation of :mod:`sys` is not thread-safe. Other threads
81 The :option:`-m` option offering equivalent functionality from the
102 module globals dictionary. As with a script name supplied to the CPython
105 module (e.g. a zipfile containing a top-level ``__main__.py`` file).
107 For a simple script, the specified code is simply executed in a fresh
115 The optional dictionary argument *init_globals* may be used to pre-populate
116 the module's globals dictionary before the code is executed. The supplied
123 dictionary before the module code is executed (Note that this is a
124 minimal set of variables - other variables may be set implicitly as an
130 If the supplied path directly references a script file (whether as source
139 :ref:`set as normal <import-mod-attrs>` based on the module spec.
145 modifications to items in :mod:`sys` are reverted before the function
150 allowing the execution of sys.path entries. As the thread-safety
155 :ref:`using-on-interface-options` for equivalent functionality on the
156 command line (``python path/to/script``).
168 :pep:`338` -- Executing modules as scripts
171 :pep:`366` -- Main module explicit relative imports
174 :pep:`451` -- A ModuleSpec Type for the Import System
177 :ref:`using-on-general` - CPython command line details