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 @@ -101,6 +101,11 @@ source.
101
101
first element will be set to ``"-m" ``). As with the :option: `-c ` option,
102
102
the current directory will be added to the start of :data: `sys.path `.
103
103
104
+ :option: `-I ` option can be used to run the script in isolated mode where
105
+ :data: `sys.path ` contains neither the current directory nor the user's
106
+ site-packages directory. All :envvar: `PYTHON* ` environment variables are
107
+ ignored, too.
108
+
104
109
Many standard library modules contain code that is invoked on their execution
105
110
as a script. An example is the :mod: `timeit ` module::
106
111
@@ -121,6 +126,7 @@ source.
121
126
.. versionchanged :: 3.4
122
127
namespace packages are also supported
123
128
129
+ .. _cmdarg-dash :
124
130
125
131
.. describe :: -
126
132
@@ -133,6 +139,8 @@ source.
133
139
134
140
.. audit-event :: cpython.run_stdin "" ""
135
141
142
+ .. _cmdarg-script :
143
+
136
144
.. describe :: <script>
137
145
138
146
Execute the Python code contained in *script *, which must be a filesystem
@@ -151,6 +159,11 @@ source.
151
159
added to the start of :data: `sys.path ` and the ``__main__.py `` file in
152
160
that location is executed as the :mod: `__main__ ` module.
153
161
162
+ :option: `-I ` option can be used to run the script in isolated mode where
163
+ :data: `sys.path ` contains neither the script's directory nor the user's
164
+ site-packages directory. All :envvar: `PYTHON* ` environment variables are
165
+ ignored, too.
166
+
154
167
.. audit-event :: cpython.run_file filename
155
168
156
169
.. seealso ::
You can’t perform that action at this time.
0 commit comments