File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -100,6 +100,11 @@ source.
100100 first element will be set to ``"-m" ``). As with the :option: `-c ` option,
101101 the current directory will be added to the start of :data: `sys.path `.
102102
103+ :option: `-I ` option can be used to run the script in isolated mode where
104+ :data: `sys.path ` contains neither the current directory nor the user's
105+ site-packages directory. All :envvar: `PYTHON* ` environment variables are
106+ ignored, too.
107+
103108 Many standard library modules contain code that is invoked on their execution
104109 as a script. An example is the :mod: `timeit ` module::
105110
@@ -119,6 +124,7 @@ source.
119124 .. versionchanged :: 3.4
120125 namespace packages are also supported
121126
127+ .. _cmdarg-dash :
122128
123129.. describe :: -
124130
@@ -130,6 +136,8 @@ source.
130136 :data: `sys.path `.
131137
132138
139+ .. _cmdarg-script :
140+
133141.. describe :: <script>
134142
135143 Execute the Python code contained in *script *, which must be a filesystem
@@ -148,6 +156,11 @@ source.
148156 added to the start of :data: `sys.path ` and the ``__main__.py `` file in
149157 that location is executed as the :mod: `__main__ ` module.
150158
159+ :option: `-I ` option can be used to run the script in isolated mode where
160+ :data: `sys.path ` contains neither the script's directory nor the user's
161+ site-packages directory. All :envvar: `PYTHON* ` environment variables are
162+ ignored, too.
163+
151164 .. seealso ::
152165 :func: `runpy.run_path `
153166 Equivalent functionality directly available to Python code
You can’t perform that action at this time.
0 commit comments