diff --git a/Doc/using/cmdline.rst b/Doc/using/cmdline.rst index b61df8a..0e75ce5 100644 --- a/Doc/using/cmdline.rst +++ b/Doc/using/cmdline.rst @@ -99,6 +99,11 @@ source. full path to the module file (while the module file is being located, the first element will be set to ``"-m"``). As with the :option:`-c` option, the current directory will be added to the start of :data:`sys.path`. + :option:`-I` option can be used to run the script in isolated mode where + :data:`sys.path` contains neither the script's directory nor the user's + site-packages directory. All :envvar:`PYTHON*` environment variables are + ignored, too. + Many standard library modules contain code that is invoked on their execution as a script. An example is the :mod:`timeit` module:: @@ -148,5 +153,10 @@ source. added to the start of :data:`sys.path` and the ``__main__.py`` file in that location is executed as the :mod:`__main__` module. + :option:`-I` option can be used to run the script in isolated mode where + :data:`sys.path` contains neither the script's directory nor the user's + site-packages directory. All :envvar:`PYTHON*` environment variables are + ignored, too. + .. seealso:: :func:`runpy.run_path` Equivalent functionality directly available to Python code