chunk_id large_stringlengths 36 36 | doc_type large_stringclasses 2
values | category large_stringclasses 17
values | document large_stringclasses 50
values | version_raw large_stringclasses 590
values | chunk_index int64 0 262 | text large_stringlengths 11 5.69k | file_path large_stringclasses 882
values |
|---|---|---|---|---|---|---|---|
67158d9a-e7c4-5b1b-bc35-d9c0d58c3047 | docs | python | python_cmdline | 38 | 1 | commands and executes them until an EOF (an end-of-file character, you can
produce that with `Ctrl-D` on UNIX or `Ctrl-Z, Enter` on Windows) is read.
* When called with a file name argument or with a file as standard input, it
reads and executes a script from that file.
* When called with a directory name argumen... | large_dataset/raw/docs/python/cmdline/cmdline_38.md |
575c6957-05c9-53b6-9551-766623105480 | docs | python | python_cmdline | 38 | 2 | element, subscript zero (`sys.argv[0]`), is a string reflecting the program’s
source.
`-c` `<command>`[¶](#cmdoption-c "Permalink to this definition")
: Execute the Python code in *command*. *command* can be one or more
statements separated by newlines, with significant leading whitespace as in
normal module... | large_dataset/raw/docs/python/cmdline/cmdline_38.md |
e7a26304-96d1-5379-ad60-578765539798 | docs | python | python_cmdline | 38 | 3 | the [`__main__`](../library/__main__.html#module-__main__ "__main__: The environment where the top-level script is run.") module.
Since the argument is a *module* name, you must not give a file extension
(`.py`). The module name should be a valid absolute Python module name, but
the implementation may ... | large_dataset/raw/docs/python/cmdline/cmdline_38.md |
49e56e68-1add-527a-ba4c-2de4193d4b63 | docs | python | python_cmdline | 38 | 4 | file is not available.
If this option is given, the first element of [`sys.argv`](../library/sys.html#sys.argv "sys.argv") will be the
full path to the module file (while the module file is being located, the
first element will be set to `"-m"`). As with the [`-c`](#cmdoption-c) option,
the current... | large_dataset/raw/docs/python/cmdline/cmdline_38.md |
6d423123-952e-522c-a2ad-591c3a3ea74f | docs | python | python_cmdline | 38 | 5 | python -m timeit -h # for details
```
Raises an [auditing event](../library/sys.html#auditing) `cpython.run_module` with argument `module-name`.
See also
[`runpy.run_module()`](../library/runpy.html#runpy.run_module "runpy.run_module")
: Equivalent functionality directly available to Python... | large_dataset/raw/docs/python/cmdline/cmdline_38.md |
eea021af-f57f-51b5-97fe-fa1e22e8df7d | docs | python | python_cmdline | 38 | 6 | Raises an [auditing event](../library/sys.html#auditing) `cpython.run_stdin` with no arguments.
`<script>`
: Execute the Python code contained in *script*, which must be a filesystem
path (absolute or relative) referring to either a Python file, a directory
containing a `__main__.py` file, or a zipfile c... | large_dataset/raw/docs/python/cmdline/cmdline_38.md |
db93ebc3-acf6-5a89-a246-89a32c8dd6f8 | docs | python | python_cmdline | 38 | 7 | added to the start of [`sys.path`](../library/sys.html#sys.path "sys.path") and the `__main__.py` file in
that location is executed as the [`__main__`](../library/__main__.html#module-__main__ "__main__: The environment where the top-level script is run.") module.
[`-I`](#id2) option can be used to run the... | large_dataset/raw/docs/python/cmdline/cmdline_38.md |
9e26320d-f3ce-5227-84d6-e761427cb24f | docs | python | python_cmdline | 38 | 8 | start of [`sys.path`](../library/sys.html#sys.path "sys.path"). Also, tab-completion and history editing is
automatically enabled, if available on your platform (see
[Readline configuration](../library/site.html#rlcompleter-config)).
See also
[Invoking the Interpreter](../tutorial/interpreter.html#tut-invoking)
Chan... | large_dataset/raw/docs/python/cmdline/cmdline_38.md |
4c97b86e-f2cc-523e-a0cc-50592400425e | docs | python | python_cmdline | 38 | 9 | Python 3.8.0b2+ (3.8:0c076caaa8, Apr 20 2019, 21:55:00)
[GCC 6.2.0 20161005]
```
New in version 3.6: The `-VV` option.
### 1.1.3. Miscellaneous options[¶](#miscellaneous-options "Permalink to this headline")
`-b`[¶](#cmdoption-b "Permalink to this definition")
: Issue a warning when comparing [`byt... | large_dataset/raw/docs/python/cmdline/cmdline_38.md |
c43cb9ac-39d2-5d95-a98b-77228c9eb613 | docs | python | python_cmdline | 38 | 10 | `--check-hash-based-pycs` `default|always|never`[¶](#cmdoption-check-hash-based-pycs "Permalink to this definition")
: Control the validation behavior of hash-based `.pyc` files. See
[Cached bytecode invalidation](../reference/import.html#pyc-invalidation). When set to `default`, checked and unchecked
hash-ba... | large_dataset/raw/docs/python/cmdline/cmdline_38.md |
c58e36fb-67d9-5d79-b870-b0c02d75aa6b | docs | python | python_cmdline | 38 | 11 | : Ignore all `PYTHON*` environment variables, e.g.
[`PYTHONPATH`](#envvar-PYTHONPATH) and [`PYTHONHOME`](#envvar-PYTHONHOME), that might be set.
`-i`[¶](#cmdoption-i "Permalink to this definition")
: When a script is passed as first argument or the [`-c`](#cmdoption-c) option is used,
enter interactive mod... | large_dataset/raw/docs/python/cmdline/cmdline_38.md |
be562873-bfe9-595f-af1b-301dbdaa414a | docs | python | python_cmdline | 38 | 12 | variables are ignored, too. Further restrictions may be imposed to prevent
the user from injecting malicious code.
New in version 3.4.
`-O`[¶](#cmdoption-o "Permalink to this definition")
: Remove assert statements and any code conditional on the value of
[`__debug__`](../library/constants.html#__de... | large_dataset/raw/docs/python/cmdline/cmdline_38.md |
d044900f-85b9-57ef-bd8f-9e7ed7b6d27d | docs | python | python_cmdline | 38 | 13 | `.pyc` extension (see [**PEP 488**](https://www.python.org/dev/peps/pep-0488)).
Changed in version 3.5: Modify `.pyc` filenames according to [**PEP 488**](https://www.python.org/dev/peps/pep-0488).
`-q`[¶](#cmdoption-q "Permalink to this definition")
: Don’t display the copyright and version messages even i... | large_dataset/raw/docs/python/cmdline/cmdline_38.md |
3951a00f-055c-57d2-b858-8e6b408670f6 | docs | python | python_cmdline | 38 | 14 | Hash randomization is intended to provide protection against a
denial-of-service caused by carefully-chosen inputs that exploit the worst
case performance of a dict construction, O(n^2) complexity. See
<http://www.ocert.org/advisories/ocert-2011-003.html> for details.
[`PYTHONHASHSEED`](#envvar-PYT... | large_dataset/raw/docs/python/cmdline/cmdline_38.md |
b5908d23-de4b-5f39-a4db-4e9e90768ea6 | docs | python | python_cmdline | 38 | 15 | manipulations of [`sys.path`](../library/sys.html#sys.path "sys.path") that it entails. Also disable these
manipulations if [`site`](../library/site.html#module-site "site: Module responsible for site-specific configuration.") is explicitly imported later (call
[`site.main()`](../library/site.html#site.main... | large_dataset/raw/docs/python/cmdline/cmdline_38.md |
b7cdb26c-4677-5017-87d9-22ae0135a966 | docs | python | python_cmdline | 38 | 16 | searching for a module. Also provides information on module cleanup at exit.
See also [`PYTHONVERBOSE`](#envvar-PYTHONVERBOSE).
`-W` `arg`[¶](#cmdoption-w "Permalink to this definition")
: Warning control. Python’s warning machinery by default prints warning
messages to [`sys.stderr`](../library/sys.html... | large_dataset/raw/docs/python/cmdline/cmdline_38.md |
fa354dea-d809-550d-b291-a2e18933eab3 | docs | python | python_cmdline | 38 | 17 | environment variable and from within a Python program using the
[`warnings`](../library/warnings.html#module-warnings "warnings: Issue warning messages and control their disposition.") module.
The simplest settings apply a particular action unconditionally to all
warnings emitted by a process (even tho... | large_dataset/raw/docs/python/cmdline/cmdline_38.md |
7ad3eeae-7d4c-51d9-ae76-ead2f17ea08b | docs | python | python_cmdline | 38 | 18 | : Skip the first line of the source, allowing use of non-Unix forms of
`#!cmd`. This is intended for a DOS specific hack only.
`-X`[¶](#id5 "Permalink to this definition")
: Reserved for various implementation-specific options. CPython currently
defines the following possible values:
* `-X faulthandle... | large_dataset/raw/docs/python/cmdline/cmdline_38.md |
2f2dc18b-fcbc-5129-b50b-687e12610726 | docs | python | python_cmdline | 38 | 19 | tracing with a traceback limit of *NFRAME* frames. See the
[`tracemalloc.start()`](../library/tracemalloc.html#tracemalloc.start "tracemalloc.start") for more information.
* `-X showalloccount` to output the total count of allocated objects for
each type when the program finishes. This only works ... | large_dataset/raw/docs/python/cmdline/cmdline_38.md |
0863e9b9-f383-5fe8-aef5-9d51b42669eb | docs | python | python_cmdline | 38 | 20 | * `-X dev`: enable CPython’s “development mode”, introducing additional
runtime checks which are too expensive to be enabled by default. It should
not be more verbose than the default if the code is correct: new warnings
are only emitted when an issue is detected. Effect of the developer mode:
... | large_dataset/raw/docs/python/cmdline/cmdline_38.md |
c8eb9a4c-0239-559c-a2a7-8e56cf36beb1 | docs | python | python_cmdline | 38 | 21 | + [`io.IOBase`](../library/io.html#io.IOBase "io.IOBase") destructor logs `close()` exceptions.
* `-X utf8` enables UTF-8 mode for operating system interfaces, overriding
the default locale-aware mode. `-X utf8=0` explicitly disables UTF-8
mode (even when it would otherwise activate automatically)... | large_dataset/raw/docs/python/cmdline/cmdline_38.md |
411a3ca5-6c79-5fa1-b943-be64a7b6f162 | docs | python | python_cmdline | 38 | 22 | New in version 3.7: The `-X importtime`, `-X dev` and `-X utf8` options.
New in version 3.8: The `-X pycache_prefix` option. The `-X dev` option now logs
`close()` exceptions in [`io.IOBase`](../library/io.html#io.IOBase "io.IOBase") destructor.
New in version 3.8.14: The `-X int_max_str_digits` optio... | large_dataset/raw/docs/python/cmdline/cmdline_38.md |
ae133dc9-ebc4-5d9b-968d-d7cb2508d573 | docs | python | python_cmdline | 38 | 23 | libraries are searched in `prefix/lib/pythonversion` and
`exec_prefix/lib/pythonversion`, where `prefix` and
`exec_prefix` are installation-dependent directories, both defaulting
to `/usr/local`.
When [`PYTHONHOME`](#envvar-PYTHONHOME) is set to a single directory, its value replaces
both `pref... | large_dataset/raw/docs/python/cmdline/cmdline_38.md |
38207812-0840-5485-a484-75935c8076d0 | docs | python | python_cmdline | 38 | 24 | compiled form). Extension modules cannot be imported from zipfiles.
The default search path is installation dependent, but generally begins with
`prefix/lib/pythonversion` (see [`PYTHONHOME`](#envvar-PYTHONHOME) above). It
is *always* appended to [`PYTHONPATH`](#envvar-PYTHONPATH).
An additional d... | large_dataset/raw/docs/python/cmdline/cmdline_38.md |
21c5e7f5-c756-5a3f-954d-92fbf7dd7362 | docs | python | python_cmdline | 38 | 25 | that objects defined or imported in it can be used without qualification in
the interactive session. You can also change the prompts [`sys.ps1`](../library/sys.html#sys.ps1 "sys.ps1") and
[`sys.ps2`](../library/sys.html#sys.ps2 "sys.ps2") and the hook [`sys.__interactivehook__`](../library/sys.html#sys.__in... | large_dataset/raw/docs/python/cmdline/cmdline_38.md |
fccf84e3-774b-5739-9e2f-b98bdfa15870 | docs | python | python_cmdline | 38 | 26 | containing the callable will be imported and then the callable will be run
by the default implementation of [`sys.breakpointhook()`](../library/sys.html#sys.breakpointhook "sys.breakpointhook") which itself is
called by built-in [`breakpoint()`](../library/functions.html#breakpoint "breakpoint"). If not set... | large_dataset/raw/docs/python/cmdline/cmdline_38.md |
55e68e3c-5ba5-5dc6-8a1d-6a6ca1bda341 | docs | python | python_cmdline | 38 | 27 | : If this is set to a non-empty string it is equivalent to specifying the
[`-i`](#cmdoption-i) option.
This variable can also be modified by Python code using [`os.environ`](../library/os.html#os.environ "os.environ")
to force inspect mode on program termination.
Raises an [auditing event](../librar... | large_dataset/raw/docs/python/cmdline/cmdline_38.md |
1936dc4a-bbc4-5b4e-aba7-12a131d5b28f | docs | python | python_cmdline | 38 | 28 | : If this is set, Python ignores case in [`import`](../reference/simple_stmts.html#import) statements. This
only works on Windows and OS X.
`PYTHONDONTWRITEBYTECODE`[¶](#envvar-PYTHONDONTWRITEBYTECODE "Permalink to this definition")
: If this is set to a non-empty string, Python won’t try to write `.pyc`
f... | large_dataset/raw/docs/python/cmdline/cmdline_38.md |
6a37b9cc-36b5-5271-8dcc-b3c05594ae00 | docs | python | python_cmdline | 38 | 29 | If [`PYTHONHASHSEED`](#envvar-PYTHONHASHSEED) is set to an integer value, it is used as a fixed
seed for generating the hash() of the types covered by the hash
randomization.
Its purpose is to allow repeatable hashing, such as for selftests for the
interpreter itself, or to allow a cluster of pytho... | large_dataset/raw/docs/python/cmdline/cmdline_38.md |
46305312-8413-5cb0-a7b2-7ba27665f031 | docs | python | python_cmdline | 38 | 30 | for stdin/stdout/stderr, in the syntax `encodingname:errorhandler`. Both
the `encodingname` and the `:errorhandler` parts are optional and have
the same meaning as in [`str.encode()`](../library/stdtypes.html#str.encode "str.encode").
For stderr, the `:errorhandler` part is ignored; the handler will al... | large_dataset/raw/docs/python/cmdline/cmdline_38.md |
b2af9cc5-c3bc-59c8-b0d0-433bce2f12f6 | docs | python | python_cmdline | 38 | 31 | [**PEP 370**](https://www.python.org/dev/peps/pep-0370) – Per user site-packages directory
`PYTHONUSERBASE`[¶](#envvar-PYTHONUSERBASE "Permalink to this definition")
: Defines the [`user base directory`](../library/site.html#site.USER_BASE "site.USER_BASE"), which is used to
compute the path of the [`user si... | large_dataset/raw/docs/python/cmdline/cmdline_38.md |
23660d33-c7f8-582e-b181-8fed701306aa | docs | python | python_cmdline | 38 | 32 | : This is equivalent to the [`-W`](#cmdoption-w) option. If set to a comma
separated string, it is equivalent to specifying [`-W`](#cmdoption-w) multiple
times, with filters later in the list taking precedence over those earlier
in the list.
The simplest settings apply a particular action uncondition... | large_dataset/raw/docs/python/cmdline/cmdline_38.md |
7eacf75e-7dc8-5552-9dd1-9848e91f0225 | docs | python | python_cmdline | 38 | 33 | : If this environment variable is set to a non-empty string,
[`faulthandler.enable()`](../library/faulthandler.html#faulthandler.enable "faulthandler.enable") is called at startup: install a handler for
`SIGSEGV`, `SIGFPE`, `SIGABRT`, `SIGBUS` and
`SIGILL` signals to dump the Python traceback. This is equ... | large_dataset/raw/docs/python/cmdline/cmdline_38.md |
88372fe6-7a4d-5898-902a-349367130ab9 | docs | python | python_cmdline | 38 | 34 | New in version 3.4.
`PYTHONPROFILEIMPORTTIME`[¶](#envvar-PYTHONPROFILEIMPORTTIME "Permalink to this definition")
: If this environment variable is set to a non-empty string, Python will
show how long each import takes. This is exactly equivalent to setting
`-X importtime` on the command line.
New in... | large_dataset/raw/docs/python/cmdline/cmdline_38.md |
32f3410b-d5db-517f-b3b5-7ced03a57dd4 | docs | python | python_cmdline | 38 | 35 | * `malloc`: use the `malloc()` function of the C library
for all domains ([`PYMEM_DOMAIN_RAW`](../c-api/memory.html#c.PYMEM_DOMAIN_RAW "PYMEM_DOMAIN_RAW"), [`PYMEM_DOMAIN_MEM`](../c-api/memory.html#c.PYMEM_DOMAIN_MEM "PYMEM_DOMAIN_MEM"),
[`PYMEM_DOMAIN_OBJ`](../c-api/memory.html#c.PYMEM_DOMAIN_OBJ "PYME... | large_dataset/raw/docs/python/cmdline/cmdline_38.md |
8cfa95b1-66eb-5592-a85b-03a50487b40b | docs | python | python_cmdline | 38 | 36 | * `pymalloc_debug`: same as `pymalloc` but also install debug hooks.
See the [default memory allocators](../c-api/memory.html#default-memory-allocators) and the
[`PyMem_SetupDebugHooks()`](../c-api/memory.html#c.PyMem_SetupDebugHooks "PyMem_SetupDebugHooks") function (install debug hooks on Python
memo... | large_dataset/raw/docs/python/cmdline/cmdline_38.md |
94c21c99-40af-5beb-bc97-5c6e722b5932 | docs | python | python_cmdline | 38 | 37 | Changed in version 3.6: This variable can now also be used on Python compiled in release mode.
It now has no effect if set to an empty string.
`PYTHONLEGACYWINDOWSFSENCODING`[¶](#envvar-PYTHONLEGACYWINDOWSFSENCODING "Permalink to this definition")
: If set to a non-empty string, the default filesystem encodi... | large_dataset/raw/docs/python/cmdline/cmdline_38.md |
ab3ab5e6-4bc2-5b0f-8d2f-510f46c2d6f1 | docs | python | python_cmdline | 38 | 38 | writer. This means that Unicode characters will be encoded according to
the active console code page, rather than using utf-8.
This variable is ignored if the standard streams are redirected (to files
or pipes) rather than referring to console buffers.
[Availability](../library/intro.html#availabi... | large_dataset/raw/docs/python/cmdline/cmdline_38.md |
ee4011f2-a56a-5d29-b326-ac11a68ed2a5 | docs | python | python_cmdline | 38 | 39 | `LC_CTYPE` category in the order listed before loading the interpreter
runtime:
* `C.UTF-8`
* `C.utf8`
* `UTF-8`
If setting one of these locale categories succeeds, then the `LC_CTYPE`
environment variable will also be set accordingly in the current process
environment before the Pytho... | large_dataset/raw/docs/python/cmdline/cmdline_38.md |
64ca3ee7-6207-5526-a70b-3e8e0cbf2b73 | docs | python | python_cmdline | 38 | 40 | implicit locale coercion) automatically enables the `surrogateescape`
[error handler](../library/codecs.html#error-handlers) for [`sys.stdin`](../library/sys.html#sys.stdin "sys.stdin") and
[`sys.stdout`](../library/sys.html#sys.stdout "sys.stdout") ([`sys.stderr`](../library/sys.html#sys.stderr "sys.stderr... | large_dataset/raw/docs/python/cmdline/cmdline_38.md |
40bc714e-780b-5289-8d52-f3effa9b7911 | docs | python | python_cmdline | 38 | 41 | default in legacy ASCII-based locales. Both features must be disabled in
order to force the interpreter to use `ASCII` instead of `UTF-8` for
system interfaces.
[Availability](../library/intro.html#availability): \*nix.
New in version 3.7: See [**PEP 538**](https://www.python.org/dev/peps/pep-0538... | large_dataset/raw/docs/python/cmdline/cmdline_38.md |
7689dd58-4ff9-5b23-b9f6-36307dc972bd | docs | python | python_cmdline | 38 | 42 | > * [`locale.getpreferredencoding()`](../library/locale.html#locale.getpreferredencoding "locale.getpreferredencoding") returns `'UTF-8'` (the locale
> encoding is ignored, and the function’s `do_setlocale` parameter has no
> effect).
> * [`sys.stdin`](../library/sys.html#sys.stdin "sys.stdin"), [`s... | large_dataset/raw/docs/python/cmdline/cmdline_38.md |
e67ba742-b730-5b3d-ba9b-a19c96069f2f | docs | python | python_cmdline | 38 | 43 | > * Command line arguments, environment variables and filenames are decoded
> to text using the UTF-8 encoding.
> * [`os.fsdecode()`](../library/os.html#os.fsdecode "os.fsdecode") and [`os.fsencode()`](../library/os.html#os.fsencode "os.fsencode") use the UTF-8 encoding.
> * [`open()`](../library/func... | large_dataset/raw/docs/python/cmdline/cmdline_38.md |
573aece0-f8a4-5b9f-8ded-128173081e3b | docs | python | python_cmdline | 38 | 44 | Setting any other non-empty string causes an error during interpreter
initialisation.
If this environment variable is not set at all, then the interpreter defaults
to using the current locale settings, *unless* the current locale is
identified as a legacy ASCII-based locale
(as described for [`... | large_dataset/raw/docs/python/cmdline/cmdline_38.md |
df56bf49-a7ef-5dae-b3ca-ed6e9a5decb0 | docs | python | python_cmdline | 38 | 45 | Need Python configured with the `--with-pydebug` build option.
`PYTHONDUMPREFS`[¶](#envvar-PYTHONDUMPREFS "Permalink to this definition")
: If set, Python will dump objects and reference counts still alive after
shutting down the interpreter.
Need Python configured with the `--with-trace-refs` build opt... | large_dataset/raw/docs/python/cmdline/cmdline_38.md |
b6718d2c-dd8e-59a6-9e95-b4d0d6b84316 | docs | python | python_cmdline | 39 | 0 | # 1.Command line and environment¶
Source: https://docs.python.org/3.9/using/cmdline.html
Version: 3.9
The CPython interpreter scans the command line and the environment for various
settings.
**CPython implementation detail:** Other implementations’ command line schemes may differ. See
[Alternate Implementations](../... | large_dataset/raw/docs/python/cmdline/cmdline_39.md |
404a2b0e-647f-5a79-859d-8210c311556a | docs | python | python_cmdline | 39 | 1 | commands and executes them until an EOF (an end-of-file character, you can
produce that with `Ctrl-D` on UNIX or `Ctrl-Z, Enter` on Windows) is read.
* When called with a file name argument or with a file as standard input, it
reads and executes a script from that file.
* When called with a directory name argumen... | large_dataset/raw/docs/python/cmdline/cmdline_39.md |
27155fc6-73e0-584b-aa82-3b06953dad31 | docs | python | python_cmdline | 39 | 2 | element, subscript zero (`sys.argv[0]`), is a string reflecting the program’s
source.
`-c` `<command>`[¶](#cmdoption-c "Permalink to this definition")
: Execute the Python code in *command*. *command* can be one or more
statements separated by newlines, with significant leading whitespace as in
normal module... | large_dataset/raw/docs/python/cmdline/cmdline_39.md |
abdcf23e-7089-581e-994d-0565b68fe04d | docs | python | python_cmdline | 39 | 3 | the [`__main__`](../library/__main__.html#module-__main__ "__main__: The environment where the top-level script is run.") module.
Since the argument is a *module* name, you must not give a file extension
(`.py`). The module name should be a valid absolute Python module name, but
the implementation may ... | large_dataset/raw/docs/python/cmdline/cmdline_39.md |
1524dd32-d5ae-551e-99be-a02f6a0e897f | docs | python | python_cmdline | 39 | 4 | file is not available.
If this option is given, the first element of [`sys.argv`](../library/sys.html#sys.argv "sys.argv") will be the
full path to the module file (while the module file is being located, the
first element will be set to `"-m"`). As with the [`-c`](#cmdoption-c) option,
the current... | large_dataset/raw/docs/python/cmdline/cmdline_39.md |
9f708721-73db-5801-9095-1215b766746e | docs | python | python_cmdline | 39 | 5 | python -m timeit -h # for details
```
Raises an [auditing event](../library/sys.html#auditing) `cpython.run_module` with argument `module-name`.
See also
[`runpy.run_module()`](../library/runpy.html#runpy.run_module "runpy.run_module")
: Equivalent functionality directly available to Python... | large_dataset/raw/docs/python/cmdline/cmdline_39.md |
c56d1797-15ca-56a7-bd7f-490a111c78de | docs | python | python_cmdline | 39 | 6 | Raises an [auditing event](../library/sys.html#auditing) `cpython.run_stdin` with no arguments.
`<script>`
: Execute the Python code contained in *script*, which must be a filesystem
path (absolute or relative) referring to either a Python file, a directory
containing a `__main__.py` file, or a zipfile c... | large_dataset/raw/docs/python/cmdline/cmdline_39.md |
0e9be1e5-89c7-5053-9ba2-14966bc570b1 | docs | python | python_cmdline | 39 | 7 | added to the start of [`sys.path`](../library/sys.html#sys.path "sys.path") and the `__main__.py` file in
that location is executed as the [`__main__`](../library/__main__.html#module-__main__ "__main__: The environment where the top-level script is run.") module.
[`-I`](#id2) option can be used to run the... | large_dataset/raw/docs/python/cmdline/cmdline_39.md |
be8e5dce-12f1-5a9c-b3c6-755fbe29a44b | docs | python | python_cmdline | 39 | 8 | start of [`sys.path`](../library/sys.html#sys.path "sys.path"). Also, tab-completion and history editing is
automatically enabled, if available on your platform (see
[Readline configuration](../library/site.html#rlcompleter-config)).
See also
[Invoking the Interpreter](../tutorial/interpreter.html#tut-invoking)
Chan... | large_dataset/raw/docs/python/cmdline/cmdline_39.md |
a51fdb7a-0667-55e8-ad28-295d90adcec9 | docs | python | python_cmdline | 39 | 9 | Python 3.8.0b2+ (3.8:0c076caaa8, Apr 20 2019, 21:55:00)
[GCC 6.2.0 20161005]
```
New in version 3.6: The `-VV` option.
### 1.1.3. Miscellaneous options[¶](#miscellaneous-options "Permalink to this headline")
`-b`[¶](#cmdoption-b "Permalink to this definition")
: Issue a warning when comparing [`byt... | large_dataset/raw/docs/python/cmdline/cmdline_39.md |
6a4e62f8-8314-5813-9e5c-64f49b5de9c5 | docs | python | python_cmdline | 39 | 10 | `--check-hash-based-pycs` `default|always|never`[¶](#cmdoption-check-hash-based-pycs "Permalink to this definition")
: Control the validation behavior of hash-based `.pyc` files. See
[Cached bytecode invalidation](../reference/import.html#pyc-invalidation). When set to `default`, checked and unchecked
hash-ba... | large_dataset/raw/docs/python/cmdline/cmdline_39.md |
1bb57f04-0369-56e1-b7a7-517328ee1626 | docs | python | python_cmdline | 39 | 11 | : Ignore all `PYTHON*` environment variables, e.g.
[`PYTHONPATH`](#envvar-PYTHONPATH) and [`PYTHONHOME`](#envvar-PYTHONHOME), that might be set.
`-i`[¶](#cmdoption-i "Permalink to this definition")
: When a script is passed as first argument or the [`-c`](#cmdoption-c) option is used,
enter interactive mod... | large_dataset/raw/docs/python/cmdline/cmdline_39.md |
6763f5d2-dfb0-5dcb-9d9e-a007bd9a53a1 | docs | python | python_cmdline | 39 | 12 | variables are ignored, too. Further restrictions may be imposed to prevent
the user from injecting malicious code.
New in version 3.4.
`-O`[¶](#cmdoption-o "Permalink to this definition")
: Remove assert statements and any code conditional on the value of
[`__debug__`](../library/constants.html#__de... | large_dataset/raw/docs/python/cmdline/cmdline_39.md |
2df4c71c-f17a-56e7-88b7-1fd3ef916ac6 | docs | python | python_cmdline | 39 | 13 | `.pyc` extension (see [**PEP 488**](https://www.python.org/dev/peps/pep-0488)).
Changed in version 3.5: Modify `.pyc` filenames according to [**PEP 488**](https://www.python.org/dev/peps/pep-0488).
`-q`[¶](#cmdoption-q "Permalink to this definition")
: Don’t display the copyright and version messages even i... | large_dataset/raw/docs/python/cmdline/cmdline_39.md |
d0a2aeb5-6e47-51ea-9549-28e031d5e831 | docs | python | python_cmdline | 39 | 14 | Hash randomization is intended to provide protection against a
denial-of-service caused by carefully-chosen inputs that exploit the worst
case performance of a dict construction, O(n2) complexity. See
<http://www.ocert.org/advisories/ocert-2011-003.html> for details.
[`PYTHONHASHSEED`](#envvar-PYTH... | large_dataset/raw/docs/python/cmdline/cmdline_39.md |
7924b231-8ea6-5163-8cf5-6f2b24777372 | docs | python | python_cmdline | 39 | 15 | manipulations of [`sys.path`](../library/sys.html#sys.path "sys.path") that it entails. Also disable these
manipulations if [`site`](../library/site.html#module-site "site: Module responsible for site-specific configuration.") is explicitly imported later (call
[`site.main()`](../library/site.html#site.main... | large_dataset/raw/docs/python/cmdline/cmdline_39.md |
183761d4-8a3e-5382-9ce2-fae1a93cccd7 | docs | python | python_cmdline | 39 | 16 | searching for a module. Also provides information on module cleanup at exit.
See also [`PYTHONVERBOSE`](#envvar-PYTHONVERBOSE).
`-W` `arg`[¶](#cmdoption-w "Permalink to this definition")
: Warning control. Python’s warning machinery by default prints warning
messages to [`sys.stderr`](../library/sys.html... | large_dataset/raw/docs/python/cmdline/cmdline_39.md |
f82529d3-9c56-5819-9580-68aa34376ac3 | docs | python | python_cmdline | 39 | 17 | environment variable and from within a Python program using the
[`warnings`](../library/warnings.html#module-warnings "warnings: Issue warning messages and control their disposition.") module.
The simplest settings apply a particular action unconditionally to all
warnings emitted by a process (even tho... | large_dataset/raw/docs/python/cmdline/cmdline_39.md |
64eeeaee-e606-5a00-ae24-673de4885bc9 | docs | python | python_cmdline | 39 | 18 | : Skip the first line of the source, allowing use of non-Unix forms of
`#!cmd`. This is intended for a DOS specific hack only.
`-X`[¶](#id5 "Permalink to this definition")
: Reserved for various implementation-specific options. CPython currently
defines the following possible values:
* `-X faulthandle... | large_dataset/raw/docs/python/cmdline/cmdline_39.md |
79ee4c5a-309c-5387-8ec1-1c542c6d7689 | docs | python | python_cmdline | 39 | 19 | [`tracemalloc`](../library/tracemalloc.html#module-tracemalloc "tracemalloc: Trace memory allocations.") module. By default, only the most recent frame is
stored in a traceback of a trace. Use `-X tracemalloc=NFRAME` to start
tracing with a traceback limit of *NFRAME* frames. See the
[`tracemall... | large_dataset/raw/docs/python/cmdline/cmdline_39.md |
279b4caa-224e-51d0-89cf-63fab94c7738 | docs | python | python_cmdline | 39 | 20 | asyncio'`. See also [`PYTHONPROFILEIMPORTTIME`](#envvar-PYTHONPROFILEIMPORTTIME).
* `-X dev`: enable [Python Development Mode](../library/devmode.html#devmode), introducing
additional runtime checks that are too expensive to be enabled by
default.
* `-X utf8` enables UTF-8 mode for operating s... | large_dataset/raw/docs/python/cmdline/cmdline_39.md |
ee51b013-f5b5-5785-8d8b-04f97aa0b4c2 | docs | python | python_cmdline | 39 | 21 | New in version 3.3: The `-X faulthandler` option.
New in version 3.4: The `-X showrefcount` and `-X tracemalloc` options.
New in version 3.6: The `-X showalloccount` option.
New in version 3.7: The `-X importtime`, `-X dev` and `-X utf8` options.
New in version 3.8: The `-X pycache_prefix` optio... | large_dataset/raw/docs/python/cmdline/cmdline_39.md |
15a941f3-f58e-5dfe-aa64-774240ea42d8 | docs | python | python_cmdline | 39 | 22 | ### 1.1.4. Options you shouldn’t use[¶](#options-you-shouldn-t-use "Permalink to this headline")
`-J`[¶](#cmdoption-j "Permalink to this definition")
: Reserved for use by [Jython](http://www.jython.org/).
## 1.2. Environment variables[¶](#environment-variables "Permalink to this headline")
These environment varia... | large_dataset/raw/docs/python/cmdline/cmdline_39.md |
9d4d1129-744e-5669-9ca1-9677cb565b5a | docs | python | python_cmdline | 39 | 23 | both `prefix` and `exec_prefix`. To specify different values
for these, set [`PYTHONHOME`](#envvar-PYTHONHOME) to `prefix:exec_prefix`.
`PYTHONPATH`[¶](#envvar-PYTHONPATH "Permalink to this definition")
: Augment the default search path for module files. The format is the same as
the shell’s `PATH`: one ... | large_dataset/raw/docs/python/cmdline/cmdline_39.md |
c6f393fd-2b53-598c-a9e4-73efd91f0be8 | docs | python | python_cmdline | 39 | 24 | An additional directory will be inserted in the search path in front of
[`PYTHONPATH`](#envvar-PYTHONPATH) as described above under
[Interface options](#using-on-interface-options). The search path can be manipulated from
within a Python program as the variable [`sys.path`](../library/sys.html#sys.path ... | large_dataset/raw/docs/python/cmdline/cmdline_39.md |
2bda5ad7-38c3-59fc-a389-c0e234378e8a | docs | python | python_cmdline | 39 | 25 | the interactive session. You can also change the prompts [`sys.ps1`](../library/sys.html#sys.ps1 "sys.ps1") and
[`sys.ps2`](../library/sys.html#sys.ps2 "sys.ps2") and the hook [`sys.__interactivehook__`](../library/sys.html#sys.__interactivehook__ "sys.__interactivehook__") in this file.
Raises an [auditin... | large_dataset/raw/docs/python/cmdline/cmdline_39.md |
83762281-3933-596e-93b4-b28787fc3559 | docs | python | python_cmdline | 39 | 26 | by the default implementation of [`sys.breakpointhook()`](../library/sys.html#sys.breakpointhook "sys.breakpointhook") which itself is
called by built-in [`breakpoint()`](../library/functions.html#breakpoint "breakpoint"). If not set, or set to the empty
string, it is equivalent to the value “pdb.set\_trace... | large_dataset/raw/docs/python/cmdline/cmdline_39.md |
03f0a0eb-e10d-5136-86e1-6e54d0d32f4b | docs | python | python_cmdline | 39 | 27 | See also the [`-X`](#id5) `oldparser` option and [**PEP 617**](https://www.python.org/dev/peps/pep-0617).
Deprecated since version 3.9, will be removed in version 3.10.
`PYTHONINSPECT`[¶](#envvar-PYTHONINSPECT "Permalink to this definition")
: If this is set to a non-empty string it is equivalent to specify... | large_dataset/raw/docs/python/cmdline/cmdline_39.md |
cafa54d8-092f-5a5f-b471-bdfe4cb338d3 | docs | python | python_cmdline | 39 | 28 | : If this is set to a non-empty string it is equivalent to specifying the
[`-v`](#id4) option. If set to an integer, it is equivalent to specifying
[`-v`](#id4) multiple times.
`PYTHONCASEOK`[¶](#envvar-PYTHONCASEOK "Permalink to this definition")
: If this is set, Python ignores case in [`import`](../refe... | large_dataset/raw/docs/python/cmdline/cmdline_39.md |
01fcd439-7675-5269-a36e-81a4e98b0ec1 | docs | python | python_cmdline | 39 | 29 | New in version 3.8.
`PYTHONHASHSEED`[¶](#envvar-PYTHONHASHSEED "Permalink to this definition")
: If this variable is not set or set to `random`, a random value is used
to seed the hashes of str and bytes objects.
If [`PYTHONHASHSEED`](#envvar-PYTHONHASHSEED) is set to an integer value, it is used as a f... | large_dataset/raw/docs/python/cmdline/cmdline_39.md |
079e8cb0-1eab-5f5f-a2d4-fed155ae4739 | docs | python | python_cmdline | 39 | 30 | New in version 3.9.14.
`PYTHONIOENCODING`[¶](#envvar-PYTHONIOENCODING "Permalink to this definition")
: If this is set before running the interpreter, it overrides the encoding used
for stdin/stdout/stderr, in the syntax `encodingname:errorhandler`. Both
the `encodingname` and the `:errorhandler` parts a... | large_dataset/raw/docs/python/cmdline/cmdline_39.md |
589d8b8e-5ec8-58d4-81bf-30b0c44026da | docs | python | python_cmdline | 39 | 31 | : If this is set, Python won’t add the [`user site-packages directory`](../library/site.html#site.USER_SITE "site.USER_SITE") to [`sys.path`](../library/sys.html#sys.path "sys.path").
See also
[**PEP 370**](https://www.python.org/dev/peps/pep-0370) – Per user site-packages directory
`PYTHONUSERBASE`[¶](#en... | large_dataset/raw/docs/python/cmdline/cmdline_39.md |
ab17c6ef-6bf9-5c77-9a7f-1a038b4e107a | docs | python | python_cmdline | 39 | 32 | value instead of the value got through the C runtime. Only works on
macOS.
`PYTHONWARNINGS`[¶](#envvar-PYTHONWARNINGS "Permalink to this definition")
: This is equivalent to the [`-W`](#cmdoption-w) option. If set to a comma
separated string, it is equivalent to specifying [`-W`](#cmdoption-w) multiple
... | large_dataset/raw/docs/python/cmdline/cmdline_39.md |
2dfb2584-7fff-5e5d-92ff-f5a586887ffe | docs | python | python_cmdline | 39 | 33 | See [The Warnings Filter](../library/warnings.html#warning-filter) and [Describing Warning Filters](../library/warnings.html#describing-warning-filters) for more
details.
`PYTHONFAULTHANDLER`[¶](#envvar-PYTHONFAULTHANDLER "Permalink to this definition")
: If this environment variable is set to a non-empty st... | large_dataset/raw/docs/python/cmdline/cmdline_39.md |
73a77be5-ed58-5b88-a5a4-e14d884e3bcf | docs | python | python_cmdline | 39 | 34 | the variable is the maximum number of frames stored in a traceback of a
trace. For example, `PYTHONTRACEMALLOC=1` stores only the most recent
frame. See the [`tracemalloc.start()`](../library/tracemalloc.html#tracemalloc.start "tracemalloc.start") for more information.
New in version 3.4.
`PYTHONPROFI... | large_dataset/raw/docs/python/cmdline/cmdline_39.md |
645bf7d8-00e6-55c9-a017-7884b890e5e6 | docs | python | python_cmdline | 39 | 35 | `PYTHONMALLOC`[¶](#envvar-PYTHONMALLOC "Permalink to this definition")
: Set the Python memory allocators and/or install debug hooks.
Set the family of memory allocators used by Python:
* `default`: use the [default memory allocators](../c-api/memory.html#default-memory-allocators).
* `malloc`: use the ... | large_dataset/raw/docs/python/cmdline/cmdline_39.md |
7280fb98-4972-5ce7-b67d-1e9fe04ace2d | docs | python | python_cmdline | 39 | 36 | the `malloc()` function for the [`PYMEM_DOMAIN_RAW`](../c-api/memory.html#c.PYMEM_DOMAIN_RAW "PYMEM_DOMAIN_RAW") domain.
Install debug hooks:
* `debug`: install debug hooks on top of the [default memory
allocators](../c-api/memory.html#default-memory-allocators).
* `malloc_debug`: same as `mal... | large_dataset/raw/docs/python/cmdline/cmdline_39.md |
1c15719c-d3a0-5259-b6ad-f927392f7349 | docs | python | python_cmdline | 39 | 37 | [pymalloc memory allocator](../c-api/memory.html#pymalloc) every time a new pymalloc object
arena is created, and on shutdown.
This variable is ignored if the [`PYTHONMALLOC`](#envvar-PYTHONMALLOC) environment variable
is used to force the `malloc()` allocator of the C library, or if
Python is conf... | large_dataset/raw/docs/python/cmdline/cmdline_39.md |
287b3a9d-ca62-5a29-9b27-87690b4e5dbc | docs | python | python_cmdline | 39 | 38 | [`sys._enablelegacywindowsfsencoding()`](../library/sys.html#sys._enablelegacywindowsfsencoding "sys._enablelegacywindowsfsencoding").
[Availability](../library/intro.html#availability): Windows.
New in version 3.6: See [**PEP 529**](https://www.python.org/dev/peps/pep-0529) for more details.
`PYTHONLEGA... | large_dataset/raw/docs/python/cmdline/cmdline_39.md |
b9f80eab-b2dc-531d-8ba3-de710b462519 | docs | python | python_cmdline | 39 | 39 | to skip coercing the legacy ASCII-based C and POSIX locales to a more
capable UTF-8 based alternative.
If this variable is *not* set (or is set to a value other than `0`), the
`LC_ALL` locale override environment variable is also not set, and the
current locale reported for the `LC_CTYPE` category ... | large_dataset/raw/docs/python/cmdline/cmdline_39.md |
6cb58e1d-46da-5f36-bf48-ae7ca28a69c1 | docs | python | python_cmdline | 39 | 40 | library), the updated setting is also seen in subprocesses (regardless of
whether or not those processes are running a Python interpreter), as well as
in operations that query the environment rather than the current C locale
(such as Python’s own [`locale.getdefaultlocale()`](../library/locale.html#loca... | large_dataset/raw/docs/python/cmdline/cmdline_39.md |
f5704a32-9136-59e6-b682-1e137e6d5983 | docs | python | python_cmdline | 39 | 41 | For debugging purposes, setting `PYTHONCOERCECLOCALE=warn` will cause
Python to emit warning messages on `stderr` if either the locale coercion
activates, or else if a locale that *would* have triggered coercion is
still active when the Python runtime is initialized.
Also note that even when locale... | large_dataset/raw/docs/python/cmdline/cmdline_39.md |
58b29db7-9783-5131-b55d-2c532d9caf76 | docs | python | python_cmdline | 39 | 42 | [Python Development Mode](../library/devmode.html#devmode), introducing additional runtime
checks that are too expensive to be enabled by default.
New in version 3.7.
`PYTHONUTF8`[¶](#envvar-PYTHONUTF8 "Permalink to this definition")
: If set to `1`, enables the interpreter’s UTF-8 mode, where `UTF-8` i... | large_dataset/raw/docs/python/cmdline/cmdline_39.md |
8353af72-76d2-5b52-b3dc-86e19dc179f6 | docs | python | python_cmdline | 39 | 43 | > * [`sys.stdin`](../library/sys.html#sys.stdin "sys.stdin"), [`sys.stdout`](../library/sys.html#sys.stdout "sys.stdout"), and [`sys.stderr`](../library/sys.html#sys.stderr "sys.stderr") all use
> UTF-8 as their text encoding, with the `surrogateescape`
> [error handler](../library/codecs.html#error-han... | large_dataset/raw/docs/python/cmdline/cmdline_39.md |
c16cb325-79f2-535c-acbe-1c6b498eac7d | docs | python | python_cmdline | 39 | 44 | > * [`os.fsdecode()`](../library/os.html#os.fsdecode "os.fsdecode") and [`os.fsencode()`](../library/os.html#os.fsencode "os.fsencode") use the UTF-8 encoding.
> * [`open()`](../library/functions.html#open "open"), [`io.open()`](../library/io.html#io.open "io.open"), and [`codecs.open()`](../library/codecs.html... | large_dataset/raw/docs/python/cmdline/cmdline_39.md |
67a0d392-5e9d-58fe-95fd-7660de2db79c | docs | python | python_cmdline | 39 | 45 | If this environment variable is not set at all, then the interpreter defaults
to using the current locale settings, *unless* the current locale is
identified as a legacy ASCII-based locale
(as described for [`PYTHONCOERCECLOCALE`](#envvar-PYTHONCOERCECLOCALE)), and locale coercion is
either disabled... | large_dataset/raw/docs/python/cmdline/cmdline_39.md |
db5aca88-3fee-53cf-97e9-c68127dbab38 | docs | python | python_cmdline | 39 | 46 | `PYTHONDUMPREFS`[¶](#envvar-PYTHONDUMPREFS "Permalink to this definition")
: If set, Python will dump objects and reference counts still alive after
shutting down the interpreter.
Need Python configured with the `--with-trace-refs` build option.
| large_dataset/raw/docs/python/cmdline/cmdline_39.md |
d7464b90-337e-577f-8a9e-ee4de6b08021 | docs | python | python_datamodel | 310 | 0 | # 3.Data model¶
Source: https://docs.python.org/3.10/reference/datamodel.html
Version: 3.10
## 3.1. Objects, values and types[¶](#objects-values-and-types "Permalink to this headline")
*Objects* are Python’s abstraction for data. All data in a Python program
is represented by objects or by relations between objects.... | large_dataset/raw/docs/python/datamodel/datamodel_310.md |
b8ec4cec-df54-54de-ae47-8da2765f891e | docs | python | python_datamodel | 310 | 1 | it have a length?”) and also defines the possible values for objects of that
type. The [`type()`](../library/functions.html#type "type") function returns an object’s type (which is an object
itself). Like its identity, an object’s *type* is also unchangeable.
[1](#id8)
The *value* of some objects can change. Objects w... | large_dataset/raw/docs/python/datamodel/datamodel_310.md |
f1cfa29e-4bef-5bce-afac-3edc4bc1447e | docs | python | python_datamodel | 310 | 2 | Objects are never explicitly destroyed; however, when they become unreachable
they may be garbage-collected. An implementation is allowed to postpone garbage
collection or omit it altogether — it is a matter of implementation quality
how garbage collection is implemented, as long as no objects are collected that
are st... | large_dataset/raw/docs/python/datamodel/datamodel_310.md |
5b71a1a6-28dc-5c23-b449-0da78178fb50 | docs | python | python_datamodel | 310 | 3 | Note that the use of the implementation’s tracing or debugging facilities may
keep objects alive that would normally be collectable. Also note that catching
an exception with a ‘[`try`](compound_stmts.html#try)…[`except`](compound_stmts.html#except)’ statement may keep
objects alive.
Some objects contain references to... | large_dataset/raw/docs/python/datamodel/datamodel_310.md |
2bd3c3a4-d9da-5786-864e-ebea8e51ef16 | docs | python | python_datamodel | 310 | 4 | Examples of containers are tuples, lists and dictionaries. The references are
part of a container’s value. In most cases, when we talk about the value of a
container, we imply the values, not the identities of the contained objects;
however, when we talk about the mutability of a container, only the identities
of the i... | large_dataset/raw/docs/python/datamodel/datamodel_310.md |
3d621c61-f08c-5415-83d1-c2421d9da0b6 | docs | python | python_datamodel | 310 | 5 | []`, `c` and `d` are guaranteed to refer to two different, unique, newly
created empty lists. (Note that `c = d = []` assigns the same object to both
`c` and `d`.)
## 3.2. The standard type hierarchy[¶](#the-standard-type-hierarchy "Permalink to this headline")
Below is a list of the types that are built into Python.... | large_dataset/raw/docs/python/datamodel/datamodel_310.md |
6c1d9622-6454-5f09-8ef3-a01cdc1bbb29 | docs | python | python_datamodel | 310 | 6 | object is accessed through the built-in name `None`. It is used to signify the
absence of a value in many situations, e.g., it is returned from functions that
don’t explicitly return anything. Its truth value is false.
NotImplemented
: This type has a single value. There is a single object with this valu... | large_dataset/raw/docs/python/datamodel/datamodel_310.md |
0840682f-3557-5200-ab87-4d528e7cc0e8 | docs | python | python_datamodel | 310 | 7 | it currently evaluates as true, it will emit a [`DeprecationWarning`](../library/exceptions.html#DeprecationWarning "DeprecationWarning").
It will raise a [`TypeError`](../library/exceptions.html#TypeError "TypeError") in a future version of Python.
Ellipsis
: This type has a single value. There is a single ... | large_dataset/raw/docs/python/datamodel/datamodel_310.md |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.