• Home
  • Raw
  • Download

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

1 :mod:`runpy` --- Locating and executing Python modules
13 --------------
16 importing them first. Its main use is to implement the :option:`-m` command
38 The optional dictionary argument *init_globals* may be used to pre-populate
39 the module's globals dictionary before the code is executed. The supplied
45 and ``__package__`` are set in the globals dictionary before the module
46 code is executed (Note that this is a minimal set of variables - other
68 are restored to their original values before the function returns.
70 Note that this manipulation of :mod:`sys` is not thread-safe. Other threads
76 The :option:`-m` option offering equivalent functionality from the
90 module globals dictionary. As with a script name supplied to the CPython
93 module (e.g. a zipfile containing a top-level ``__main__.py`` file).
95 For a simple script, the specified code is simply executed in a fresh
103 The optional dictionary argument *init_globals* may be used to pre-populate
104 the module's globals dictionary before the code is executed. The supplied
110 and ``__package__`` are set in the globals dictionary before the module
111 code is executed (Note that this is a minimal set of variables - other
119 to :const:`None`. For a simple script, this will be set to ``file_path``.
123 import mechanism). For a simple script, this will be set to :const:`None`.
131 modifications to items in :mod:`sys` are reverted before the function
136 allowing the execution of sys.path entries. As the thread-safety
141 :ref:`using-on-interface-options` for equivalent functionality on the
142 command line (``python path/to/script``).
148 :pep:`338` -- Executing modules as scripts
151 :pep:`366` -- Main module explicit relative imports
154 :ref:`using-on-general` - CPython command line details