Submit
Path:
~
/
/
usr
/
share
/
doc
/
python3.10
/
html
/
using
/
File Content:
cmdline.html
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" /> <title>1. Command line and environment — Python 3.10.12 documentation</title><meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" type="text/css" href="../_static/pygments.css" /> <link rel="stylesheet" type="text/css" href="../_static/pydoctheme.css?2022.1" /> <script data-url_root="../" id="documentation_options" src="../_static/documentation_options.js"></script> <script src="../_static/jquery.js"></script> <script src="../_static/underscore.js"></script> <script src="../_static/doctools.js"></script> <script src="../_static/sidebar.js"></script> <link rel="search" type="application/opensearchdescription+xml" title="Search within Python 3.10.12 documentation" href="../_static/opensearch.xml"/> <link rel="author" title="About these documents" href="../about.html" /> <link rel="index" title="Index" href="../genindex.html" /> <link rel="search" title="Search" href="../search.html" /> <link rel="copyright" title="Copyright" href="../copyright.html" /> <link rel="next" title="2. Using Python on Unix platforms" href="unix.html" /> <link rel="prev" title="Python Setup and Usage" href="index.html" /> <link rel="canonical" href="file:///usr/share/doc/python3.10/html/using/cmdline.html" /> <style> @media only screen { table.full-width-table { width: 100%; } } </style> <link rel="shortcut icon" type="image/png" href="../_static/py.svg" /> <script type="text/javascript" src="../_static/copybutton.js"></script> <script type="text/javascript" src="../_static/menu.js"></script> </head> <body> <div class="mobile-nav"> <input type="checkbox" id="menuToggler" class="toggler__input" aria-controls="navigation" aria-pressed="false" aria-expanded="false" role="button" aria-label="Menu" /> <label for="menuToggler" class="toggler__label"> <span></span> </label> <nav class="nav-content" role="navigation"> <a href="https://www.python.org/" class="nav-logo"> <img src="../_static/py.svg" alt="Logo"/> </a> <div class="version_switcher_placeholder"></div> <form role="search" class="search" action="../search.html" method="get"> <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" class="search-icon"> <path fill-rule="nonzero" d="M15.5 14h-.79l-.28-.27a6.5 6.5 0 001.48-5.34c-.47-2.78-2.79-5-5.59-5.34a6.505 6.505 0 00-7.27 7.27c.34 2.8 2.56 5.12 5.34 5.59a6.5 6.5 0 005.34-1.48l.27.28v.79l4.25 4.25c.41.41 1.08.41 1.49 0 .41-.41.41-1.08 0-1.49L15.5 14zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z" fill="#444"></path> </svg> <input type="text" name="q" aria-label="Quick search"/> <input type="submit" value="Go"/> </form> </nav> <div class="menu-wrapper"> <nav class="menu" role="navigation" aria-label="main navigation"> <div class="language_switcher_placeholder"></div> <h3><a href="../contents.html">Table of Contents</a></h3> <ul> <li><a class="reference internal" href="#">1. Command line and environment</a><ul> <li><a class="reference internal" href="#command-line">1.1. Command line</a><ul> <li><a class="reference internal" href="#interface-options">1.1.1. Interface options</a></li> <li><a class="reference internal" href="#generic-options">1.1.2. Generic options</a></li> <li><a class="reference internal" href="#miscellaneous-options">1.1.3. Miscellaneous options</a></li> <li><a class="reference internal" href="#options-you-shouldn-t-use">1.1.4. Options you shouldn’t use</a></li> </ul> </li> <li><a class="reference internal" href="#environment-variables">1.2. Environment variables</a><ul> <li><a class="reference internal" href="#debug-mode-variables">1.2.1. Debug-mode variables</a></li> </ul> </li> </ul> </li> </ul> <h4>Previous topic</h4> <p class="topless"><a href="index.html" title="previous chapter">Python Setup and Usage</a></p> <h4>Next topic</h4> <p class="topless"><a href="unix.html" title="next chapter"><span class="section-number">2. </span>Using Python on Unix platforms</a></p> <div role="note" aria-label="source link"> <h3>This Page</h3> <ul class="this-page-menu"> <li><a href="../bugs.html">Report a Bug</a></li> <li> <a href="https://github.com/python/cpython/blob/3.10/Doc/using/cmdline.rst" rel="nofollow">Show Source </a> </li> </ul> </div> </nav> </div> </div> <div class="related" role="navigation" aria-label="related navigation"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../genindex.html" title="General Index" accesskey="I">index</a></li> <li class="right" > <a href="../py-modindex.html" title="Python Module Index" >modules</a> |</li> <li class="right" > <a href="unix.html" title="2. Using Python on Unix platforms" accesskey="N">next</a> |</li> <li class="right" > <a href="index.html" title="Python Setup and Usage" accesskey="P">previous</a> |</li> <li><img src="../_static/py.svg" alt="python logo" style="vertical-align: middle; margin-top: -1px"/></li> <li><a href="https://www.python.org/">Python</a> »</li> <li class="switchers"> <div class="language_switcher_placeholder"></div> <div class="version_switcher_placeholder"></div> </li> <li> </li> <li id="cpython-language-and-version"> <a href="../index.html">3.10.12 Documentation</a> » </li> <li class="nav-item nav-item-1"><a href="index.html" accesskey="U">Python Setup and Usage</a> »</li> <li class="nav-item nav-item-this"><a href=""><span class="section-number">1. </span>Command line and environment</a></li> <li class="right"> <div class="inline-search" role="search"> <form class="inline-search" action="../search.html" method="get"> <input placeholder="Quick search" aria-label="Quick search" type="text" name="q" /> <input type="submit" value="Go" /> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> </div> | </li> </ul> </div> <div class="document"> <div class="documentwrapper"> <div class="bodywrapper"> <div class="body" role="main"> <section id="command-line-and-environment"> <span id="using-on-general"></span><h1><span class="section-number">1. </span>Command line and environment<a class="headerlink" href="#command-line-and-environment" title="Permalink to this headline">¶</a></h1> <p>The CPython interpreter scans the command line and the environment for various settings.</p> <div class="impl-detail compound"> <p><strong>CPython implementation detail:</strong> Other implementations’ command line schemes may differ. See <a class="reference internal" href="../reference/introduction.html#implementations"><span class="std std-ref">Alternate Implementations</span></a> for further resources.</p> </div> <section id="command-line"> <span id="using-on-cmdline"></span><h2><span class="section-number">1.1. </span>Command line<a class="headerlink" href="#command-line" title="Permalink to this headline">¶</a></h2> <p>When invoking Python, you may specify any of these options:</p> <div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>python <span class="o">[</span>-bBdEhiIOqsSuvVWx?<span class="o">]</span> <span class="o">[</span>-c <span class="nb">command</span> <span class="p">|</span> -m module-name <span class="p">|</span> script <span class="p">|</span> - <span class="o">]</span> <span class="o">[</span>args<span class="o">]</span> </pre></div> </div> <p>The most common use case is, of course, a simple invocation of a script:</p> <div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>python myscript.py </pre></div> </div> <section id="interface-options"> <span id="using-on-interface-options"></span><h3><span class="section-number">1.1.1. </span>Interface options<a class="headerlink" href="#interface-options" title="Permalink to this headline">¶</a></h3> <p>The interpreter interface resembles that of the UNIX shell, but provides some additional methods of invocation:</p> <ul class="simple"> <li><p>When called with standard input connected to a tty device, it prompts for commands and executes them until an EOF (an end-of-file character, you can produce that with <kbd class="kbd compound docutils literal notranslate"><kbd class="kbd docutils literal notranslate">Ctrl</kbd>-<kbd class="kbd docutils literal notranslate">D</kbd></kbd> on UNIX or <kbd class="kbd compound docutils literal notranslate"><kbd class="kbd docutils literal notranslate">Ctrl</kbd>-<kbd class="kbd docutils literal notranslate">Z,</kbd> <kbd class="kbd docutils literal notranslate">Enter</kbd></kbd> on Windows) is read.</p></li> <li><p>When called with a file name argument or with a file as standard input, it reads and executes a script from that file.</p></li> <li><p>When called with a directory name argument, it reads and executes an appropriately named script from that directory.</p></li> <li><p>When called with <code class="docutils literal notranslate"><span class="pre">-c</span> <span class="pre">command</span></code>, it executes the Python statement(s) given as <em>command</em>. Here <em>command</em> may contain multiple statements separated by newlines. Leading whitespace is significant in Python statements!</p></li> <li><p>When called with <code class="docutils literal notranslate"><span class="pre">-m</span> <span class="pre">module-name</span></code>, the given module is located on the Python module path and executed as a script.</p></li> </ul> <p>In non-interactive mode, the entire input is parsed before it is executed.</p> <p>An interface option terminates the list of options consumed by the interpreter, all consecutive arguments will end up in <a class="reference internal" href="../library/sys.html#sys.argv" title="sys.argv"><code class="xref py py-data docutils literal notranslate"><span class="pre">sys.argv</span></code></a> – note that the first element, subscript zero (<code class="docutils literal notranslate"><span class="pre">sys.argv[0]</span></code>), is a string reflecting the program’s source.</p> <dl class="std cmdoption"> <dt class="sig sig-object std" id="cmdoption-c"> <span class="sig-name descname"><span class="pre">-c</span></span><span class="sig-prename descclassname"> <span class="pre"><command></span></span><a class="headerlink" href="#cmdoption-c" title="Permalink to this definition">¶</a></dt> <dd><p>Execute the Python code in <em>command</em>. <em>command</em> can be one or more statements separated by newlines, with significant leading whitespace as in normal module code.</p> <p>If this option is given, the first element of <a class="reference internal" href="../library/sys.html#sys.argv" title="sys.argv"><code class="xref py py-data docutils literal notranslate"><span class="pre">sys.argv</span></code></a> will be <code class="docutils literal notranslate"><span class="pre">"-c"</span></code> and the current directory will be added to the start of <a class="reference internal" href="../library/sys.html#sys.path" title="sys.path"><code class="xref py py-data docutils literal notranslate"><span class="pre">sys.path</span></code></a> (allowing modules in that directory to be imported as top level modules).</p> <p class="audit-hook">Raises an <a class="reference internal" href="../library/sys.html#auditing"><span class="std std-ref">auditing event</span></a> <code class="docutils literal notranslate"><span class="pre">cpython.run_command</span></code> with argument <code class="docutils literal notranslate"><span class="pre">command</span></code>.</p> </dd></dl> <dl class="std cmdoption"> <dt class="sig sig-object std" id="cmdoption-m"> <span class="sig-name descname"><span class="pre">-m</span></span><span class="sig-prename descclassname"> <span class="pre"><module-name></span></span><a class="headerlink" href="#cmdoption-m" title="Permalink to this definition">¶</a></dt> <dd><p>Search <a class="reference internal" href="../library/sys.html#sys.path" title="sys.path"><code class="xref py py-data docutils literal notranslate"><span class="pre">sys.path</span></code></a> for the named module and execute its contents as the <a class="reference internal" href="../library/__main__.html#module-__main__" title="__main__: The environment where top-level code is run. Covers command-line interfaces, import-time behavior, and ``__name__ == '__main__'``."><code class="xref py py-mod docutils literal notranslate"><span class="pre">__main__</span></code></a> module.</p> <p>Since the argument is a <em>module</em> name, you must not give a file extension (<code class="docutils literal notranslate"><span class="pre">.py</span></code>). The module name should be a valid absolute Python module name, but the implementation may not always enforce this (e.g. it may allow you to use a name that includes a hyphen).</p> <p>Package names (including namespace packages) are also permitted. When a package name is supplied instead of a normal module, the interpreter will execute <code class="docutils literal notranslate"><span class="pre"><pkg>.__main__</span></code> as the main module. This behaviour is deliberately similar to the handling of directories and zipfiles that are passed to the interpreter as the script argument.</p> <div class="admonition note"> <p class="admonition-title">Note</p> <p>This option cannot be used with built-in modules and extension modules written in C, since they do not have Python module files. However, it can still be used for precompiled modules, even if the original source file is not available.</p> </div> <p>If this option is given, the first element of <a class="reference internal" href="../library/sys.html#sys.argv" title="sys.argv"><code class="xref py py-data docutils literal notranslate"><span class="pre">sys.argv</span></code></a> will be the full path to the module file (while the module file is being located, the first element will be set to <code class="docutils literal notranslate"><span class="pre">"-m"</span></code>). As with the <a class="reference internal" href="#cmdoption-c"><code class="xref std std-option docutils literal notranslate"><span class="pre">-c</span></code></a> option, the current directory will be added to the start of <a class="reference internal" href="../library/sys.html#sys.path" title="sys.path"><code class="xref py py-data docutils literal notranslate"><span class="pre">sys.path</span></code></a>.</p> <p><a class="reference internal" href="#cmdoption-I"><code class="xref std std-option docutils literal notranslate"><span class="pre">-I</span></code></a> option can be used to run the script in isolated mode where <a class="reference internal" href="../library/sys.html#sys.path" title="sys.path"><code class="xref py py-data docutils literal notranslate"><span class="pre">sys.path</span></code></a> contains neither the current directory nor the user’s site-packages directory. All <span class="target" id="index-0"></span><code class="xref std std-envvar docutils literal notranslate"><span class="pre">PYTHON*</span></code> environment variables are ignored, too.</p> <p>Many standard library modules contain code that is invoked on their execution as a script. An example is the <a class="reference internal" href="../library/timeit.html#module-timeit" title="timeit: Measure the execution time of small code snippets."><code class="xref py py-mod docutils literal notranslate"><span class="pre">timeit</span></code></a> module:</p> <div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>python -m timeit -s <span class="s1">'setup here'</span> <span class="s1">'benchmarked code here'</span> python -m timeit -h <span class="c1"># for details</span> </pre></div> </div> <p class="audit-hook">Raises an <a class="reference internal" href="../library/sys.html#auditing"><span class="std std-ref">auditing event</span></a> <code class="docutils literal notranslate"><span class="pre">cpython.run_module</span></code> with argument <code class="docutils literal notranslate"><span class="pre">module-name</span></code>.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <dl class="simple"> <dt><a class="reference internal" href="../library/runpy.html#runpy.run_module" title="runpy.run_module"><code class="xref py py-func docutils literal notranslate"><span class="pre">runpy.run_module()</span></code></a></dt><dd><p>Equivalent functionality directly available to Python code</p> </dd> </dl> <p><span class="target" id="index-1"></span><a class="pep reference external" href="https://www.python.org/dev/peps/pep-0338"><strong>PEP 338</strong></a> – Executing modules as scripts</p> </div> <div class="versionchanged"> <p><span class="versionmodified changed">Changed in version 3.1: </span>Supply the package name to run a <code class="docutils literal notranslate"><span class="pre">__main__</span></code> submodule.</p> </div> <div class="versionchanged"> <p><span class="versionmodified changed">Changed in version 3.4: </span>namespace packages are also supported</p> </div> </dd></dl> <span class="target" id="cmdarg-dash"></span><dl class="describe"> <dt class="sig sig-object"> <span class="sig-name descname"><span class="pre">-</span></span></dt> <dd><p>Read commands from standard input (<a class="reference internal" href="../library/sys.html#sys.stdin" title="sys.stdin"><code class="xref py py-data docutils literal notranslate"><span class="pre">sys.stdin</span></code></a>). If standard input is a terminal, <a class="reference internal" href="#cmdoption-i"><code class="xref std std-option docutils literal notranslate"><span class="pre">-i</span></code></a> is implied.</p> <p>If this option is given, the first element of <a class="reference internal" href="../library/sys.html#sys.argv" title="sys.argv"><code class="xref py py-data docutils literal notranslate"><span class="pre">sys.argv</span></code></a> will be <code class="docutils literal notranslate"><span class="pre">"-"</span></code> and the current directory will be added to the start of <a class="reference internal" href="../library/sys.html#sys.path" title="sys.path"><code class="xref py py-data docutils literal notranslate"><span class="pre">sys.path</span></code></a>.</p> <p class="audit-hook" id="audit_event_cpython_run_stdin_0">Raises an <a class="reference internal" href="../library/sys.html#auditing"><span class="std std-ref">auditing event</span></a> <code class="docutils literal notranslate"><span class="pre">cpython.run_stdin</span></code> with no arguments.</p> </dd></dl> <span class="target" id="cmdarg-script"></span><dl class="describe"> <dt class="sig sig-object"> <span class="sig-name descname"><span class="pre"><script></span></span></dt> <dd><p>Execute the Python code contained in <em>script</em>, which must be a filesystem path (absolute or relative) referring to either a Python file, a directory containing a <code class="docutils literal notranslate"><span class="pre">__main__.py</span></code> file, or a zipfile containing a <code class="docutils literal notranslate"><span class="pre">__main__.py</span></code> file.</p> <p>If this option is given, the first element of <a class="reference internal" href="../library/sys.html#sys.argv" title="sys.argv"><code class="xref py py-data docutils literal notranslate"><span class="pre">sys.argv</span></code></a> will be the script name as given on the command line.</p> <p>If the script name refers directly to a Python file, the directory containing that file is added to the start of <a class="reference internal" href="../library/sys.html#sys.path" title="sys.path"><code class="xref py py-data docutils literal notranslate"><span class="pre">sys.path</span></code></a>, and the file is executed as the <a class="reference internal" href="../library/__main__.html#module-__main__" title="__main__: The environment where top-level code is run. Covers command-line interfaces, import-time behavior, and ``__name__ == '__main__'``."><code class="xref py py-mod docutils literal notranslate"><span class="pre">__main__</span></code></a> module.</p> <p>If the script name refers to a directory or zipfile, the script name is added to the start of <a class="reference internal" href="../library/sys.html#sys.path" title="sys.path"><code class="xref py py-data docutils literal notranslate"><span class="pre">sys.path</span></code></a> and the <code class="docutils literal notranslate"><span class="pre">__main__.py</span></code> file in that location is executed as the <a class="reference internal" href="../library/__main__.html#module-__main__" title="__main__: The environment where top-level code is run. Covers command-line interfaces, import-time behavior, and ``__name__ == '__main__'``."><code class="xref py py-mod docutils literal notranslate"><span class="pre">__main__</span></code></a> module.</p> <p><a class="reference internal" href="#cmdoption-I"><code class="xref std std-option docutils literal notranslate"><span class="pre">-I</span></code></a> option can be used to run the script in isolated mode where <a class="reference internal" href="../library/sys.html#sys.path" title="sys.path"><code class="xref py py-data docutils literal notranslate"><span class="pre">sys.path</span></code></a> contains neither the script’s directory nor the user’s site-packages directory. All <span class="target" id="index-2"></span><code class="xref std std-envvar docutils literal notranslate"><span class="pre">PYTHON*</span></code> environment variables are ignored, too.</p> <p class="audit-hook" id="audit_event_cpython_run_file_0">Raises an <a class="reference internal" href="../library/sys.html#auditing"><span class="std std-ref">auditing event</span></a> <code class="docutils literal notranslate"><span class="pre">cpython.run_file</span></code> with argument <code class="docutils literal notranslate"><span class="pre">filename</span></code>.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <dl class="simple"> <dt><a class="reference internal" href="../library/runpy.html#runpy.run_path" title="runpy.run_path"><code class="xref py py-func docutils literal notranslate"><span class="pre">runpy.run_path()</span></code></a></dt><dd><p>Equivalent functionality directly available to Python code</p> </dd> </dl> </div> </dd></dl> <p>If no interface option is given, <a class="reference internal" href="#cmdoption-i"><code class="xref std std-option docutils literal notranslate"><span class="pre">-i</span></code></a> is implied, <code class="docutils literal notranslate"><span class="pre">sys.argv[0]</span></code> is an empty string (<code class="docutils literal notranslate"><span class="pre">""</span></code>) and the current directory will be added to the start of <a class="reference internal" href="../library/sys.html#sys.path" title="sys.path"><code class="xref py py-data docutils literal notranslate"><span class="pre">sys.path</span></code></a>. Also, tab-completion and history editing is automatically enabled, if available on your platform (see <a class="reference internal" href="../library/site.html#rlcompleter-config"><span class="std std-ref">Readline configuration</span></a>).</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><a class="reference internal" href="../tutorial/interpreter.html#tut-invoking"><span class="std std-ref">Invoking the Interpreter</span></a></p> </div> <div class="versionchanged"> <p><span class="versionmodified changed">Changed in version 3.4: </span>Automatic enabling of tab-completion and history editing.</p> </div> </section> <section id="generic-options"> <h3><span class="section-number">1.1.2. </span>Generic options<a class="headerlink" href="#generic-options" title="Permalink to this headline">¶</a></h3> <dl class="std cmdoption"> <dt class="sig sig-object std" id="cmdoption-0"> <span id="cmdoption"></span><span class="sig-name descname"><span class="pre">-?</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-0" title="Permalink to this definition">¶</a></dt> <dt class="sig sig-object std" id="cmdoption-h"> <span class="sig-name descname"><span class="pre">-h</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-h" title="Permalink to this definition">¶</a></dt> <dt class="sig sig-object std" id="cmdoption-help"> <span class="sig-name descname"><span class="pre">--help</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-help" title="Permalink to this definition">¶</a></dt> <dd><p>Print a short description of all command line options.</p> </dd></dl> <dl class="std cmdoption"> <dt class="sig sig-object std" id="cmdoption-V"> <span id="cmdoption-v"></span><span class="sig-name descname"><span class="pre">-V</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-V" title="Permalink to this definition">¶</a></dt> <dt class="sig sig-object std" id="cmdoption-version"> <span class="sig-name descname"><span class="pre">--version</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-version" title="Permalink to this definition">¶</a></dt> <dd><p>Print the Python version number and exit. Example output could be:</p> <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>Python 3.8.0b2+ </pre></div> </div> <p>When given twice, print more information about the build, like:</p> <div class="highlight-none notranslate"><div class="highlight"><pre><span></span>Python 3.8.0b2+ (3.8:0c076caaa8, Apr 20 2019, 21:55:00) [GCC 6.2.0 20161005] </pre></div> </div> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.6: </span>The <code class="docutils literal notranslate"><span class="pre">-VV</span></code> option.</p> </div> </dd></dl> </section> <section id="miscellaneous-options"> <span id="using-on-misc-options"></span><h3><span class="section-number">1.1.3. </span>Miscellaneous options<a class="headerlink" href="#miscellaneous-options" title="Permalink to this headline">¶</a></h3> <dl class="std cmdoption"> <dt class="sig sig-object std" id="cmdoption-b"> <span class="sig-name descname"><span class="pre">-b</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-b" title="Permalink to this definition">¶</a></dt> <dd><p>Issue a warning when comparing <a class="reference internal" href="../library/stdtypes.html#bytes" title="bytes"><code class="xref py py-class docutils literal notranslate"><span class="pre">bytes</span></code></a> or <a class="reference internal" href="../library/stdtypes.html#bytearray" title="bytearray"><code class="xref py py-class docutils literal notranslate"><span class="pre">bytearray</span></code></a> with <a class="reference internal" href="../library/stdtypes.html#str" title="str"><code class="xref py py-class docutils literal notranslate"><span class="pre">str</span></code></a> or <a class="reference internal" href="../library/stdtypes.html#bytes" title="bytes"><code class="xref py py-class docutils literal notranslate"><span class="pre">bytes</span></code></a> with <a class="reference internal" href="../library/functions.html#int" title="int"><code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code></a>. Issue an error when the option is given twice (<code class="xref std std-option docutils literal notranslate"><span class="pre">-bb</span></code>).</p> <div class="versionchanged"> <p><span class="versionmodified changed">Changed in version 3.5: </span>Affects comparisons of <a class="reference internal" href="../library/stdtypes.html#bytes" title="bytes"><code class="xref py py-class docutils literal notranslate"><span class="pre">bytes</span></code></a> with <a class="reference internal" href="../library/functions.html#int" title="int"><code class="xref py py-class docutils literal notranslate"><span class="pre">int</span></code></a>.</p> </div> </dd></dl> <dl class="std cmdoption"> <dt class="sig sig-object std" id="cmdoption-B"> <span class="sig-name descname"><span class="pre">-B</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-B" title="Permalink to this definition">¶</a></dt> <dd><p>If given, Python won’t try to write <code class="docutils literal notranslate"><span class="pre">.pyc</span></code> files on the import of source modules. See also <span class="target" id="index-3"></span><a class="reference internal" href="#envvar-PYTHONDONTWRITEBYTECODE"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">PYTHONDONTWRITEBYTECODE</span></code></a>.</p> </dd></dl> <dl class="std cmdoption"> <dt class="sig sig-object std" id="cmdoption-check-hash-based-pycs"> <span class="sig-name descname"><span class="pre">--check-hash-based-pycs</span></span><span class="sig-prename descclassname"> <span class="pre">default|always|never</span></span><a class="headerlink" href="#cmdoption-check-hash-based-pycs" title="Permalink to this definition">¶</a></dt> <dd><p>Control the validation behavior of hash-based <code class="docutils literal notranslate"><span class="pre">.pyc</span></code> files. See <a class="reference internal" href="../reference/import.html#pyc-invalidation"><span class="std std-ref">Cached bytecode invalidation</span></a>. When set to <code class="docutils literal notranslate"><span class="pre">default</span></code>, checked and unchecked hash-based bytecode cache files are validated according to their default semantics. When set to <code class="docutils literal notranslate"><span class="pre">always</span></code>, all hash-based <code class="docutils literal notranslate"><span class="pre">.pyc</span></code> files, whether checked or unchecked, are validated against their corresponding source file. When set to <code class="docutils literal notranslate"><span class="pre">never</span></code>, hash-based <code class="docutils literal notranslate"><span class="pre">.pyc</span></code> files are not validated against their corresponding source files.</p> <p>The semantics of timestamp-based <code class="docutils literal notranslate"><span class="pre">.pyc</span></code> files are unaffected by this option.</p> </dd></dl> <dl class="std cmdoption"> <dt class="sig sig-object std" id="cmdoption-d"> <span class="sig-name descname"><span class="pre">-d</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-d" title="Permalink to this definition">¶</a></dt> <dd><p>Turn on parser debugging output (for expert only, depending on compilation options). See also <span class="target" id="index-4"></span><a class="reference internal" href="#envvar-PYTHONDEBUG"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">PYTHONDEBUG</span></code></a>.</p> </dd></dl> <dl class="std cmdoption"> <dt class="sig sig-object std" id="cmdoption-E"> <span id="cmdoption-e"></span><span class="sig-name descname"><span class="pre">-E</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-E" title="Permalink to this definition">¶</a></dt> <dd><p>Ignore all <span class="target" id="index-5"></span><code class="xref std std-envvar docutils literal notranslate"><span class="pre">PYTHON*</span></code> environment variables, e.g. <span class="target" id="index-6"></span><a class="reference internal" href="#envvar-PYTHONPATH"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">PYTHONPATH</span></code></a> and <span class="target" id="index-7"></span><a class="reference internal" href="#envvar-PYTHONHOME"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">PYTHONHOME</span></code></a>, that might be set.</p> </dd></dl> <dl class="std cmdoption"> <dt class="sig sig-object std" id="cmdoption-i"> <span class="sig-name descname"><span class="pre">-i</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-i" title="Permalink to this definition">¶</a></dt> <dd><p>When a script is passed as first argument or the <a class="reference internal" href="#cmdoption-c"><code class="xref std std-option docutils literal notranslate"><span class="pre">-c</span></code></a> option is used, enter interactive mode after executing the script or the command, even when <a class="reference internal" href="../library/sys.html#sys.stdin" title="sys.stdin"><code class="xref py py-data docutils literal notranslate"><span class="pre">sys.stdin</span></code></a> does not appear to be a terminal. The <span class="target" id="index-8"></span><a class="reference internal" href="#envvar-PYTHONSTARTUP"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">PYTHONSTARTUP</span></code></a> file is not read.</p> <p>This can be useful to inspect global variables or a stack trace when a script raises an exception. See also <span class="target" id="index-9"></span><a class="reference internal" href="#envvar-PYTHONINSPECT"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">PYTHONINSPECT</span></code></a>.</p> </dd></dl> <dl class="std cmdoption"> <dt class="sig sig-object std" id="cmdoption-I"> <span class="sig-name descname"><span class="pre">-I</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-I" title="Permalink to this definition">¶</a></dt> <dd><p>Run Python in isolated mode. This also implies -E and -s. In isolated mode <a class="reference internal" href="../library/sys.html#sys.path" title="sys.path"><code class="xref py py-data docutils literal notranslate"><span class="pre">sys.path</span></code></a> contains neither the script’s directory nor the user’s site-packages directory. All <span class="target" id="index-10"></span><code class="xref std std-envvar docutils literal notranslate"><span class="pre">PYTHON*</span></code> environment variables are ignored, too. Further restrictions may be imposed to prevent the user from injecting malicious code.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.4.</span></p> </div> </dd></dl> <dl class="std cmdoption"> <dt class="sig sig-object std" id="cmdoption-O"> <span id="cmdoption-o"></span><span class="sig-name descname"><span class="pre">-O</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-O" title="Permalink to this definition">¶</a></dt> <dd><p>Remove assert statements and any code conditional on the value of <a class="reference internal" href="../library/constants.html#debug__" title="__debug__"><code class="xref py py-const docutils literal notranslate"><span class="pre">__debug__</span></code></a>. Augment the filename for compiled (<a class="reference internal" href="../glossary.html#term-bytecode"><span class="xref std std-term">bytecode</span></a>) files by adding <code class="docutils literal notranslate"><span class="pre">.opt-1</span></code> before the <code class="docutils literal notranslate"><span class="pre">.pyc</span></code> extension (see <span class="target" id="index-11"></span><a class="pep reference external" href="https://www.python.org/dev/peps/pep-0488"><strong>PEP 488</strong></a>). See also <span class="target" id="index-12"></span><a class="reference internal" href="#envvar-PYTHONOPTIMIZE"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">PYTHONOPTIMIZE</span></code></a>.</p> <div class="versionchanged"> <p><span class="versionmodified changed">Changed in version 3.5: </span>Modify <code class="docutils literal notranslate"><span class="pre">.pyc</span></code> filenames according to <span class="target" id="index-13"></span><a class="pep reference external" href="https://www.python.org/dev/peps/pep-0488"><strong>PEP 488</strong></a>.</p> </div> </dd></dl> <dl class="std cmdoption"> <dt class="sig sig-object std" id="cmdoption-OO"> <span id="cmdoption-oo"></span><span class="sig-name descname"><span class="pre">-OO</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-OO" title="Permalink to this definition">¶</a></dt> <dd><p>Do <a class="reference internal" href="#cmdoption-O"><code class="xref std std-option docutils literal notranslate"><span class="pre">-O</span></code></a> and also discard docstrings. Augment the filename for compiled (<a class="reference internal" href="../glossary.html#term-bytecode"><span class="xref std std-term">bytecode</span></a>) files by adding <code class="docutils literal notranslate"><span class="pre">.opt-2</span></code> before the <code class="docutils literal notranslate"><span class="pre">.pyc</span></code> extension (see <span class="target" id="index-14"></span><a class="pep reference external" href="https://www.python.org/dev/peps/pep-0488"><strong>PEP 488</strong></a>).</p> <div class="versionchanged"> <p><span class="versionmodified changed">Changed in version 3.5: </span>Modify <code class="docutils literal notranslate"><span class="pre">.pyc</span></code> filenames according to <span class="target" id="index-15"></span><a class="pep reference external" href="https://www.python.org/dev/peps/pep-0488"><strong>PEP 488</strong></a>.</p> </div> </dd></dl> <dl class="std cmdoption"> <dt class="sig sig-object std" id="cmdoption-q"> <span class="sig-name descname"><span class="pre">-q</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-q" title="Permalink to this definition">¶</a></dt> <dd><p>Don’t display the copyright and version messages even in interactive mode.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.2.</span></p> </div> </dd></dl> <dl class="std cmdoption"> <dt class="sig sig-object std" id="cmdoption-R"> <span id="cmdoption-r"></span><span class="sig-name descname"><span class="pre">-R</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-R" title="Permalink to this definition">¶</a></dt> <dd><p>Turn on hash randomization. This option only has an effect if the <span class="target" id="index-16"></span><a class="reference internal" href="#envvar-PYTHONHASHSEED"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">PYTHONHASHSEED</span></code></a> environment variable is set to <code class="docutils literal notranslate"><span class="pre">0</span></code>, since hash randomization is enabled by default.</p> <p>On previous versions of Python, this option turns on hash randomization, so that the <code class="xref py py-meth docutils literal notranslate"><span class="pre">__hash__()</span></code> values of str and bytes objects are “salted” with an unpredictable random value. Although they remain constant within an individual Python process, they are not predictable between repeated invocations of Python.</p> <p>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<sup>2</sup>) complexity. See <a class="reference external" href="http://www.ocert.org/advisories/ocert-2011-003.html">http://www.ocert.org/advisories/ocert-2011-003.html</a> for details.</p> <p><span class="target" id="index-17"></span><a class="reference internal" href="#envvar-PYTHONHASHSEED"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">PYTHONHASHSEED</span></code></a> allows you to set a fixed value for the hash seed secret.</p> <div class="versionchanged"> <p><span class="versionmodified changed">Changed in version 3.7: </span>The option is no longer ignored.</p> </div> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.2.3.</span></p> </div> </dd></dl> <dl class="std cmdoption"> <dt class="sig sig-object std" id="cmdoption-s"> <span class="sig-name descname"><span class="pre">-s</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-s" title="Permalink to this definition">¶</a></dt> <dd><p>Don’t add the <a class="reference internal" href="../library/site.html#site.USER_SITE" title="site.USER_SITE"><code class="xref py py-data docutils literal notranslate"><span class="pre">user</span> <span class="pre">site-packages</span> <span class="pre">directory</span></code></a> to <a class="reference internal" href="../library/sys.html#sys.path" title="sys.path"><code class="xref py py-data docutils literal notranslate"><span class="pre">sys.path</span></code></a>.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><span class="target" id="index-18"></span><a class="pep reference external" href="https://www.python.org/dev/peps/pep-0370"><strong>PEP 370</strong></a> – Per user site-packages directory</p> </div> </dd></dl> <dl class="std cmdoption"> <dt class="sig sig-object std" id="cmdoption-S"> <span class="sig-name descname"><span class="pre">-S</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-S" title="Permalink to this definition">¶</a></dt> <dd><p>Disable the import of the module <a class="reference internal" href="../library/site.html#module-site" title="site: Module responsible for site-specific configuration."><code class="xref py py-mod docutils literal notranslate"><span class="pre">site</span></code></a> and the site-dependent manipulations of <a class="reference internal" href="../library/sys.html#sys.path" title="sys.path"><code class="xref py py-data docutils literal notranslate"><span class="pre">sys.path</span></code></a> that it entails. Also disable these manipulations if <a class="reference internal" href="../library/site.html#module-site" title="site: Module responsible for site-specific configuration."><code class="xref py py-mod docutils literal notranslate"><span class="pre">site</span></code></a> is explicitly imported later (call <a class="reference internal" href="../library/site.html#site.main" title="site.main"><code class="xref py py-func docutils literal notranslate"><span class="pre">site.main()</span></code></a> if you want them to be triggered).</p> </dd></dl> <dl class="std cmdoption"> <dt class="sig sig-object std" id="cmdoption-u"> <span class="sig-name descname"><span class="pre">-u</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-u" title="Permalink to this definition">¶</a></dt> <dd><p>Force the stdout and stderr streams to be unbuffered. This option has no effect on the stdin stream.</p> <p>See also <span class="target" id="index-19"></span><a class="reference internal" href="#envvar-PYTHONUNBUFFERED"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">PYTHONUNBUFFERED</span></code></a>.</p> <div class="versionchanged"> <p><span class="versionmodified changed">Changed in version 3.7: </span>The text layer of the stdout and stderr streams now is unbuffered.</p> </div> </dd></dl> <dl class="std cmdoption"> <dt class="sig sig-object std" id="cmdoption-1"> <span class="sig-name descname"><span class="pre">-v</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-1" title="Permalink to this definition">¶</a></dt> <dd><p>Print a message each time a module is initialized, showing the place (filename or built-in module) from which it is loaded. When given twice (<code class="xref std std-option docutils literal notranslate"><span class="pre">-vv</span></code>), print a message for each file that is checked for when searching for a module. Also provides information on module cleanup at exit.</p> <div class="versionchanged"> <p><span class="versionmodified changed">Changed in version 3.10: </span>The <a class="reference internal" href="../library/site.html#module-site" title="site: Module responsible for site-specific configuration."><code class="xref py py-mod docutils literal notranslate"><span class="pre">site</span></code></a> module reports the site-specific paths and <code class="file docutils literal notranslate"><span class="pre">.pth</span></code> files being processed.</p> </div> <p>See also <span class="target" id="index-20"></span><a class="reference internal" href="#envvar-PYTHONVERBOSE"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">PYTHONVERBOSE</span></code></a>.</p> </dd></dl> <span class="target" id="using-on-warnings"></span><dl class="std cmdoption"> <dt class="sig sig-object std" id="cmdoption-W"> <span id="cmdoption-w"></span><span class="sig-name descname"><span class="pre">-W</span></span><span class="sig-prename descclassname"> <span class="pre">arg</span></span><a class="headerlink" href="#cmdoption-W" title="Permalink to this definition">¶</a></dt> <dd><p>Warning control. Python’s warning machinery by default prints warning messages to <a class="reference internal" href="../library/sys.html#sys.stderr" title="sys.stderr"><code class="xref py py-data docutils literal notranslate"><span class="pre">sys.stderr</span></code></a>.</p> <p>The simplest settings apply a particular action unconditionally to all warnings emitted by a process (even those that are otherwise ignored by default):</p> <div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>-Wdefault <span class="c1"># Warn once per call location</span> -Werror <span class="c1"># Convert to exceptions</span> -Walways <span class="c1"># Warn every time</span> -Wmodule <span class="c1"># Warn once per calling module</span> -Wonce <span class="c1"># Warn once per Python process</span> -Wignore <span class="c1"># Never warn</span> </pre></div> </div> <p>The action names can be abbreviated as desired and the interpreter will resolve them to the appropriate action name. For example, <code class="docutils literal notranslate"><span class="pre">-Wi</span></code> is the same as <code class="docutils literal notranslate"><span class="pre">-Wignore</span></code>.</p> <p>The full form of argument is:</p> <div class="highlight-sh notranslate"><div class="highlight"><pre><span></span>action:message:category:module:lineno </pre></div> </div> <p>Empty fields match all values; trailing empty fields may be omitted. For example <code class="docutils literal notranslate"><span class="pre">-W</span> <span class="pre">ignore::DeprecationWarning</span></code> ignores all DeprecationWarning warnings.</p> <p>The <em>action</em> field is as explained above but only applies to warnings that match the remaining fields.</p> <p>The <em>message</em> field must match the whole warning message; this match is case-insensitive.</p> <p>The <em>category</em> field matches the warning category (ex: <code class="docutils literal notranslate"><span class="pre">DeprecationWarning</span></code>). This must be a class name; the match test whether the actual warning category of the message is a subclass of the specified warning category.</p> <p>The <em>module</em> field matches the (fully qualified) module name; this match is case-sensitive.</p> <p>The <em>lineno</em> field matches the line number, where zero matches all line numbers and is thus equivalent to an omitted line number.</p> <p>Multiple <a class="reference internal" href="#cmdoption-W"><code class="xref std std-option docutils literal notranslate"><span class="pre">-W</span></code></a> options can be given; when a warning matches more than one option, the action for the last matching option is performed. Invalid <a class="reference internal" href="#cmdoption-W"><code class="xref std std-option docutils literal notranslate"><span class="pre">-W</span></code></a> options are ignored (though, a warning message is printed about invalid options when the first warning is issued).</p> <p>Warnings can also be controlled using the <span class="target" id="index-21"></span><a class="reference internal" href="#envvar-PYTHONWARNINGS"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">PYTHONWARNINGS</span></code></a> environment variable and from within a Python program using the <a class="reference internal" href="../library/warnings.html#module-warnings" title="warnings: Issue warning messages and control their disposition."><code class="xref py py-mod docutils literal notranslate"><span class="pre">warnings</span></code></a> module. For example, the <a class="reference internal" href="../library/warnings.html#warnings.filterwarnings" title="warnings.filterwarnings"><code class="xref py py-func docutils literal notranslate"><span class="pre">warnings.filterwarnings()</span></code></a> function can be used to use a regular expression on the warning message.</p> <p>See <a class="reference internal" href="../library/warnings.html#warning-filter"><span class="std std-ref">The Warnings Filter</span></a> and <a class="reference internal" href="../library/warnings.html#describing-warning-filters"><span class="std std-ref">Describing Warning Filters</span></a> for more details.</p> </dd></dl> <dl class="std cmdoption"> <dt class="sig sig-object std" id="cmdoption-x"> <span class="sig-name descname"><span class="pre">-x</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-x" title="Permalink to this definition">¶</a></dt> <dd><p>Skip the first line of the source, allowing use of non-Unix forms of <code class="docutils literal notranslate"><span class="pre">#!cmd</span></code>. This is intended for a DOS specific hack only.</p> </dd></dl> <dl class="std cmdoption"> <dt class="sig sig-object std" id="cmdoption-X"> <span class="sig-name descname"><span class="pre">-X</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-X" title="Permalink to this definition">¶</a></dt> <dd><p>Reserved for various implementation-specific options. CPython currently defines the following possible values:</p> <ul class="simple"> <li><p><code class="docutils literal notranslate"><span class="pre">-X</span> <span class="pre">faulthandler</span></code> to enable <a class="reference internal" href="../library/faulthandler.html#module-faulthandler" title="faulthandler: Dump the Python traceback."><code class="xref py py-mod docutils literal notranslate"><span class="pre">faulthandler</span></code></a>;</p></li> <li><p><code class="docutils literal notranslate"><span class="pre">-X</span> <span class="pre">showrefcount</span></code> to output the total reference count and number of used memory blocks when the program finishes or after each statement in the interactive interpreter. This only works on <a class="reference internal" href="configure.html#debug-build"><span class="std std-ref">debug builds</span></a>.</p></li> <li><p><code class="docutils literal notranslate"><span class="pre">-X</span> <span class="pre">tracemalloc</span></code> to start tracing Python memory allocations using the <a class="reference internal" href="../library/tracemalloc.html#module-tracemalloc" title="tracemalloc: Trace memory allocations."><code class="xref py py-mod docutils literal notranslate"><span class="pre">tracemalloc</span></code></a> module. By default, only the most recent frame is stored in a traceback of a trace. Use <code class="docutils literal notranslate"><span class="pre">-X</span> <span class="pre">tracemalloc=NFRAME</span></code> to start tracing with a traceback limit of <em>NFRAME</em> frames. See the <a class="reference internal" href="../library/tracemalloc.html#tracemalloc.start" title="tracemalloc.start"><code class="xref py py-func docutils literal notranslate"><span class="pre">tracemalloc.start()</span></code></a> for more information.</p></li> <li><p><code class="docutils literal notranslate"><span class="pre">-X</span> <span class="pre">int_max_str_digits</span></code> configures the <a class="reference internal" href="../library/stdtypes.html#int-max-str-digits"><span class="std std-ref">integer string conversion length limitation</span></a>. See also <span class="target" id="index-22"></span><a class="reference internal" href="#envvar-PYTHONINTMAXSTRDIGITS"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">PYTHONINTMAXSTRDIGITS</span></code></a>.</p></li> <li><p><code class="docutils literal notranslate"><span class="pre">-X</span> <span class="pre">importtime</span></code> to show how long each import takes. It shows module name, cumulative time (including nested imports) and self time (excluding nested imports). Note that its output may be broken in multi-threaded application. Typical usage is <code class="docutils literal notranslate"><span class="pre">python3</span> <span class="pre">-X</span> <span class="pre">importtime</span> <span class="pre">-c</span> <span class="pre">'import</span> <span class="pre">asyncio'</span></code>. See also <span class="target" id="index-23"></span><a class="reference internal" href="#envvar-PYTHONPROFILEIMPORTTIME"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">PYTHONPROFILEIMPORTTIME</span></code></a>.</p></li> <li><p><code class="docutils literal notranslate"><span class="pre">-X</span> <span class="pre">dev</span></code>: enable <a class="reference internal" href="../library/devmode.html#devmode"><span class="std std-ref">Python Development Mode</span></a>, introducing additional runtime checks that are too expensive to be enabled by default.</p></li> <li><p><code class="docutils literal notranslate"><span class="pre">-X</span> <span class="pre">utf8</span></code> enables the <a class="reference internal" href="../library/os.html#utf8-mode"><span class="std std-ref">Python UTF-8 Mode</span></a>. <code class="docutils literal notranslate"><span class="pre">-X</span> <span class="pre">utf8=0</span></code> explicitly disables <a class="reference internal" href="../library/os.html#utf8-mode"><span class="std std-ref">Python UTF-8 Mode</span></a> (even when it would otherwise activate automatically).</p></li> <li><p><code class="docutils literal notranslate"><span class="pre">-X</span> <span class="pre">pycache_prefix=PATH</span></code> enables writing <code class="docutils literal notranslate"><span class="pre">.pyc</span></code> files to a parallel tree rooted at the given directory instead of to the code tree. See also <span class="target" id="index-24"></span><a class="reference internal" href="#envvar-PYTHONPYCACHEPREFIX"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">PYTHONPYCACHEPREFIX</span></code></a>.</p></li> <li><p><code class="docutils literal notranslate"><span class="pre">-X</span> <span class="pre">warn_default_encoding</span></code> issues a <a class="reference internal" href="../library/exceptions.html#EncodingWarning" title="EncodingWarning"><code class="xref py py-class docutils literal notranslate"><span class="pre">EncodingWarning</span></code></a> when the locale-specific default encoding is used for opening files. See also <span class="target" id="index-25"></span><a class="reference internal" href="#envvar-PYTHONWARNDEFAULTENCODING"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">PYTHONWARNDEFAULTENCODING</span></code></a>.</p></li> </ul> <p>It also allows passing arbitrary values and retrieving them through the <a class="reference internal" href="../library/sys.html#sys._xoptions" title="sys._xoptions"><code class="xref py py-data docutils literal notranslate"><span class="pre">sys._xoptions</span></code></a> dictionary.</p> <div class="versionchanged"> <p><span class="versionmodified changed">Changed in version 3.2: </span>The <a class="reference internal" href="#cmdoption-X"><code class="xref std std-option docutils literal notranslate"><span class="pre">-X</span></code></a> option was added.</p> </div> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.3: </span>The <code class="docutils literal notranslate"><span class="pre">-X</span> <span class="pre">faulthandler</span></code> option.</p> </div> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.4: </span>The <code class="docutils literal notranslate"><span class="pre">-X</span> <span class="pre">showrefcount</span></code> and <code class="docutils literal notranslate"><span class="pre">-X</span> <span class="pre">tracemalloc</span></code> options.</p> </div> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.6: </span>The <code class="docutils literal notranslate"><span class="pre">-X</span> <span class="pre">showalloccount</span></code> option.</p> </div> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.7: </span>The <code class="docutils literal notranslate"><span class="pre">-X</span> <span class="pre">importtime</span></code>, <code class="docutils literal notranslate"><span class="pre">-X</span> <span class="pre">dev</span></code> and <code class="docutils literal notranslate"><span class="pre">-X</span> <span class="pre">utf8</span></code> options.</p> </div> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.8: </span>The <code class="docutils literal notranslate"><span class="pre">-X</span> <span class="pre">pycache_prefix</span></code> option. The <code class="docutils literal notranslate"><span class="pre">-X</span> <span class="pre">dev</span></code> option now logs <code class="docutils literal notranslate"><span class="pre">close()</span></code> exceptions in <a class="reference internal" href="../library/io.html#io.IOBase" title="io.IOBase"><code class="xref py py-class docutils literal notranslate"><span class="pre">io.IOBase</span></code></a> destructor.</p> </div> <div class="versionchanged"> <p><span class="versionmodified changed">Changed in version 3.9: </span>Using <code class="docutils literal notranslate"><span class="pre">-X</span> <span class="pre">dev</span></code> option, check <em>encoding</em> and <em>errors</em> arguments on string encoding and decoding operations.</p> <p>The <code class="docutils literal notranslate"><span class="pre">-X</span> <span class="pre">showalloccount</span></code> option has been removed.</p> </div> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.10: </span>The <code class="docutils literal notranslate"><span class="pre">-X</span> <span class="pre">warn_default_encoding</span></code> option.</p> </div> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.10.7: </span>The <code class="docutils literal notranslate"><span class="pre">-X</span> <span class="pre">int_max_str_digits</span></code> option.</p> </div> <div class="deprecated-removed"> <p><span class="versionmodified">Deprecated since version 3.9, removed in version 3.10: </span>The <code class="docutils literal notranslate"><span class="pre">-X</span> <span class="pre">oldparser</span></code> option.</p> </div> </dd></dl> </section> <section id="options-you-shouldn-t-use"> <h3><span class="section-number">1.1.4. </span>Options you shouldn’t use<a class="headerlink" href="#options-you-shouldn-t-use" title="Permalink to this headline">¶</a></h3> <dl class="std cmdoption"> <dt class="sig sig-object std" id="cmdoption-J"> <span id="cmdoption-j"></span><span class="sig-name descname"><span class="pre">-J</span></span><span class="sig-prename descclassname"></span><a class="headerlink" href="#cmdoption-J" title="Permalink to this definition">¶</a></dt> <dd><p>Reserved for use by <a class="reference external" href="https://www.jython.org/">Jython</a>.</p> </dd></dl> </section> </section> <section id="environment-variables"> <span id="using-on-envvars"></span><h2><span class="section-number">1.2. </span>Environment variables<a class="headerlink" href="#environment-variables" title="Permalink to this headline">¶</a></h2> <p>These environment variables influence Python’s behavior, they are processed before the command-line switches other than -E or -I. It is customary that command-line switches override environmental variables where there is a conflict.</p> <dl class="std envvar"> <dt class="sig sig-object std" id="envvar-PYTHONHOME"> <span class="sig-name descname"><span class="pre">PYTHONHOME</span></span><a class="headerlink" href="#envvar-PYTHONHOME" title="Permalink to this definition">¶</a></dt> <dd><p>Change the location of the standard Python libraries. By default, the libraries are searched in <code class="file docutils literal notranslate"><em><span class="pre">prefix</span></em><span class="pre">/lib/python</span><em><span class="pre">version</span></em></code> and <code class="file docutils literal notranslate"><em><span class="pre">exec_prefix</span></em><span class="pre">/lib/python</span><em><span class="pre">version</span></em></code>, where <code class="file docutils literal notranslate"><em><span class="pre">prefix</span></em></code> and <code class="file docutils literal notranslate"><em><span class="pre">exec_prefix</span></em></code> are installation-dependent directories, both defaulting to <code class="file docutils literal notranslate"><span class="pre">/usr/local</span></code>.</p> <p>When <span class="target" id="index-26"></span><a class="reference internal" href="#envvar-PYTHONHOME"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">PYTHONHOME</span></code></a> is set to a single directory, its value replaces both <code class="file docutils literal notranslate"><em><span class="pre">prefix</span></em></code> and <code class="file docutils literal notranslate"><em><span class="pre">exec_prefix</span></em></code>. To specify different values for these, set <span class="target" id="index-27"></span><a class="reference internal" href="#envvar-PYTHONHOME"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">PYTHONHOME</span></code></a> to <code class="file docutils literal notranslate"><em><span class="pre">prefix</span></em><span class="pre">:</span><em><span class="pre">exec_prefix</span></em></code>.</p> </dd></dl> <dl class="std envvar"> <dt class="sig sig-object std" id="envvar-PYTHONPATH"> <span class="sig-name descname"><span class="pre">PYTHONPATH</span></span><a class="headerlink" href="#envvar-PYTHONPATH" title="Permalink to this definition">¶</a></dt> <dd><p>Augment the default search path for module files. The format is the same as the shell’s <span class="target" id="index-28"></span><code class="xref std std-envvar docutils literal notranslate"><span class="pre">PATH</span></code>: one or more directory pathnames separated by <a class="reference internal" href="../library/os.html#os.pathsep" title="os.pathsep"><code class="xref py py-data docutils literal notranslate"><span class="pre">os.pathsep</span></code></a> (e.g. colons on Unix or semicolons on Windows). Non-existent directories are silently ignored.</p> <p>In addition to normal directories, individual <span class="target" id="index-29"></span><a class="reference internal" href="#envvar-PYTHONPATH"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">PYTHONPATH</span></code></a> entries may refer to zipfiles containing pure Python modules (in either source or compiled form). Extension modules cannot be imported from zipfiles.</p> <p>The default search path is installation dependent, but generally begins with <code class="file docutils literal notranslate"><em><span class="pre">prefix</span></em><span class="pre">/lib/python</span><em><span class="pre">version</span></em></code> (see <span class="target" id="index-30"></span><a class="reference internal" href="#envvar-PYTHONHOME"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">PYTHONHOME</span></code></a> above). It is <em>always</em> appended to <span class="target" id="index-31"></span><a class="reference internal" href="#envvar-PYTHONPATH"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">PYTHONPATH</span></code></a>.</p> <p>An additional directory will be inserted in the search path in front of <span class="target" id="index-32"></span><a class="reference internal" href="#envvar-PYTHONPATH"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">PYTHONPATH</span></code></a> as described above under <a class="reference internal" href="#using-on-interface-options"><span class="std std-ref">Interface options</span></a>. The search path can be manipulated from within a Python program as the variable <a class="reference internal" href="../library/sys.html#sys.path" title="sys.path"><code class="xref py py-data docutils literal notranslate"><span class="pre">sys.path</span></code></a>.</p> </dd></dl> <dl class="std envvar"> <dt class="sig sig-object std" id="envvar-PYTHONPLATLIBDIR"> <span class="sig-name descname"><span class="pre">PYTHONPLATLIBDIR</span></span><a class="headerlink" href="#envvar-PYTHONPLATLIBDIR" title="Permalink to this definition">¶</a></dt> <dd><p>If this is set to a non-empty string, it overrides the <a class="reference internal" href="../library/sys.html#sys.platlibdir" title="sys.platlibdir"><code class="xref py py-data docutils literal notranslate"><span class="pre">sys.platlibdir</span></code></a> value.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.9.</span></p> </div> </dd></dl> <dl class="std envvar"> <dt class="sig sig-object std" id="envvar-PYTHONSTARTUP"> <span class="sig-name descname"><span class="pre">PYTHONSTARTUP</span></span><a class="headerlink" href="#envvar-PYTHONSTARTUP" title="Permalink to this definition">¶</a></dt> <dd><p>If this is the name of a readable file, the Python commands in that file are executed before the first prompt is displayed in interactive mode. The file is executed in the same namespace where interactive commands are executed so that objects defined or imported in it can be used without qualification in the interactive session. You can also change the prompts <a class="reference internal" href="../library/sys.html#sys.ps1" title="sys.ps1"><code class="xref py py-data docutils literal notranslate"><span class="pre">sys.ps1</span></code></a> and <a class="reference internal" href="../library/sys.html#sys.ps2" title="sys.ps2"><code class="xref py py-data docutils literal notranslate"><span class="pre">sys.ps2</span></code></a> and the hook <a class="reference internal" href="../library/sys.html#sys.__interactivehook__" title="sys.__interactivehook__"><code class="xref py py-data docutils literal notranslate"><span class="pre">sys.__interactivehook__</span></code></a> in this file.</p> <p class="audit-hook"><p>Raises an <a class="reference internal" href="../library/sys.html#auditing"><span class="std std-ref">auditing event</span></a> <code class="docutils literal notranslate"><span class="pre">cpython.run_startup</span></code> with the filename as the argument when called on startup.</p> </p> </dd></dl> <dl class="std envvar"> <dt class="sig sig-object std" id="envvar-PYTHONOPTIMIZE"> <span class="sig-name descname"><span class="pre">PYTHONOPTIMIZE</span></span><a class="headerlink" href="#envvar-PYTHONOPTIMIZE" title="Permalink to this definition">¶</a></dt> <dd><p>If this is set to a non-empty string it is equivalent to specifying the <a class="reference internal" href="#cmdoption-O"><code class="xref std std-option docutils literal notranslate"><span class="pre">-O</span></code></a> option. If set to an integer, it is equivalent to specifying <a class="reference internal" href="#cmdoption-O"><code class="xref std std-option docutils literal notranslate"><span class="pre">-O</span></code></a> multiple times.</p> </dd></dl> <dl class="std envvar"> <dt class="sig sig-object std" id="envvar-PYTHONBREAKPOINT"> <span class="sig-name descname"><span class="pre">PYTHONBREAKPOINT</span></span><a class="headerlink" href="#envvar-PYTHONBREAKPOINT" title="Permalink to this definition">¶</a></dt> <dd><p>If this is set, it names a callable using dotted-path notation. The module containing the callable will be imported and then the callable will be run by the default implementation of <a class="reference internal" href="../library/sys.html#sys.breakpointhook" title="sys.breakpointhook"><code class="xref py py-func docutils literal notranslate"><span class="pre">sys.breakpointhook()</span></code></a> which itself is called by built-in <a class="reference internal" href="../library/functions.html#breakpoint" title="breakpoint"><code class="xref py py-func docutils literal notranslate"><span class="pre">breakpoint()</span></code></a>. If not set, or set to the empty string, it is equivalent to the value “pdb.set_trace”. Setting this to the string “0” causes the default implementation of <a class="reference internal" href="../library/sys.html#sys.breakpointhook" title="sys.breakpointhook"><code class="xref py py-func docutils literal notranslate"><span class="pre">sys.breakpointhook()</span></code></a> to do nothing but return immediately.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.7.</span></p> </div> </dd></dl> <dl class="std envvar"> <dt class="sig sig-object std" id="envvar-PYTHONDEBUG"> <span class="sig-name descname"><span class="pre">PYTHONDEBUG</span></span><a class="headerlink" href="#envvar-PYTHONDEBUG" title="Permalink to this definition">¶</a></dt> <dd><p>If this is set to a non-empty string it is equivalent to specifying the <a class="reference internal" href="#cmdoption-d"><code class="xref std std-option docutils literal notranslate"><span class="pre">-d</span></code></a> option. If set to an integer, it is equivalent to specifying <a class="reference internal" href="#cmdoption-d"><code class="xref std std-option docutils literal notranslate"><span class="pre">-d</span></code></a> multiple times.</p> </dd></dl> <dl class="std envvar"> <dt class="sig sig-object std" id="envvar-PYTHONINSPECT"> <span class="sig-name descname"><span class="pre">PYTHONINSPECT</span></span><a class="headerlink" href="#envvar-PYTHONINSPECT" title="Permalink to this definition">¶</a></dt> <dd><p>If this is set to a non-empty string it is equivalent to specifying the <a class="reference internal" href="#cmdoption-i"><code class="xref std std-option docutils literal notranslate"><span class="pre">-i</span></code></a> option.</p> <p>This variable can also be modified by Python code using <a class="reference internal" href="../library/os.html#os.environ" title="os.environ"><code class="xref py py-data docutils literal notranslate"><span class="pre">os.environ</span></code></a> to force inspect mode on program termination.</p> </dd></dl> <dl class="std envvar"> <dt class="sig sig-object std" id="envvar-PYTHONUNBUFFERED"> <span class="sig-name descname"><span class="pre">PYTHONUNBUFFERED</span></span><a class="headerlink" href="#envvar-PYTHONUNBUFFERED" title="Permalink to this definition">¶</a></dt> <dd><p>If this is set to a non-empty string it is equivalent to specifying the <a class="reference internal" href="#cmdoption-u"><code class="xref std std-option docutils literal notranslate"><span class="pre">-u</span></code></a> option.</p> </dd></dl> <dl class="std envvar"> <dt class="sig sig-object std" id="envvar-PYTHONVERBOSE"> <span class="sig-name descname"><span class="pre">PYTHONVERBOSE</span></span><a class="headerlink" href="#envvar-PYTHONVERBOSE" title="Permalink to this definition">¶</a></dt> <dd><p>If this is set to a non-empty string it is equivalent to specifying the <a class="reference internal" href="#cmdoption-1"><code class="xref std std-option docutils literal notranslate"><span class="pre">-v</span></code></a> option. If set to an integer, it is equivalent to specifying <a class="reference internal" href="#cmdoption-1"><code class="xref std std-option docutils literal notranslate"><span class="pre">-v</span></code></a> multiple times.</p> </dd></dl> <dl class="std envvar"> <dt class="sig sig-object std" id="envvar-PYTHONCASEOK"> <span class="sig-name descname"><span class="pre">PYTHONCASEOK</span></span><a class="headerlink" href="#envvar-PYTHONCASEOK" title="Permalink to this definition">¶</a></dt> <dd><p>If this is set, Python ignores case in <a class="reference internal" href="../reference/simple_stmts.html#import"><code class="xref std std-keyword docutils literal notranslate"><span class="pre">import</span></code></a> statements. This only works on Windows and macOS.</p> </dd></dl> <dl class="std envvar"> <dt class="sig sig-object std" id="envvar-PYTHONDONTWRITEBYTECODE"> <span class="sig-name descname"><span class="pre">PYTHONDONTWRITEBYTECODE</span></span><a class="headerlink" href="#envvar-PYTHONDONTWRITEBYTECODE" title="Permalink to this definition">¶</a></dt> <dd><p>If this is set to a non-empty string, Python won’t try to write <code class="docutils literal notranslate"><span class="pre">.pyc</span></code> files on the import of source modules. This is equivalent to specifying the <a class="reference internal" href="#cmdoption-B"><code class="xref std std-option docutils literal notranslate"><span class="pre">-B</span></code></a> option.</p> </dd></dl> <dl class="std envvar"> <dt class="sig sig-object std" id="envvar-PYTHONPYCACHEPREFIX"> <span class="sig-name descname"><span class="pre">PYTHONPYCACHEPREFIX</span></span><a class="headerlink" href="#envvar-PYTHONPYCACHEPREFIX" title="Permalink to this definition">¶</a></dt> <dd><p>If this is set, Python will write <code class="docutils literal notranslate"><span class="pre">.pyc</span></code> files in a mirror directory tree at this path, instead of in <code class="docutils literal notranslate"><span class="pre">__pycache__</span></code> directories within the source tree. This is equivalent to specifying the <a class="reference internal" href="#cmdoption-X"><code class="xref std std-option docutils literal notranslate"><span class="pre">-X</span></code></a> <code class="docutils literal notranslate"><span class="pre">pycache_prefix=PATH</span></code> option.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.8.</span></p> </div> </dd></dl> <dl class="std envvar"> <dt class="sig sig-object std" id="envvar-PYTHONHASHSEED"> <span class="sig-name descname"><span class="pre">PYTHONHASHSEED</span></span><a class="headerlink" href="#envvar-PYTHONHASHSEED" title="Permalink to this definition">¶</a></dt> <dd><p>If this variable is not set or set to <code class="docutils literal notranslate"><span class="pre">random</span></code>, a random value is used to seed the hashes of str and bytes objects.</p> <p>If <span class="target" id="index-33"></span><a class="reference internal" href="#envvar-PYTHONHASHSEED"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">PYTHONHASHSEED</span></code></a> 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.</p> <p>Its purpose is to allow repeatable hashing, such as for selftests for the interpreter itself, or to allow a cluster of python processes to share hash values.</p> <p>The integer must be a decimal number in the range [0,4294967295]. Specifying the value 0 will disable hash randomization.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.2.3.</span></p> </div> </dd></dl> <dl class="std envvar"> <dt class="sig sig-object std" id="envvar-PYTHONINTMAXSTRDIGITS"> <span class="sig-name descname"><span class="pre">PYTHONINTMAXSTRDIGITS</span></span><a class="headerlink" href="#envvar-PYTHONINTMAXSTRDIGITS" title="Permalink to this definition">¶</a></dt> <dd><p>If this variable is set to an integer, it is used to configure the interpreter’s global <a class="reference internal" href="../library/stdtypes.html#int-max-str-digits"><span class="std std-ref">integer string conversion length limitation</span></a>.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.10.7.</span></p> </div> </dd></dl> <dl class="std envvar"> <dt class="sig sig-object std" id="envvar-PYTHONIOENCODING"> <span class="sig-name descname"><span class="pre">PYTHONIOENCODING</span></span><a class="headerlink" href="#envvar-PYTHONIOENCODING" title="Permalink to this definition">¶</a></dt> <dd><p>If this is set before running the interpreter, it overrides the encoding used for stdin/stdout/stderr, in the syntax <code class="docutils literal notranslate"><span class="pre">encodingname:errorhandler</span></code>. Both the <code class="docutils literal notranslate"><span class="pre">encodingname</span></code> and the <code class="docutils literal notranslate"><span class="pre">:errorhandler</span></code> parts are optional and have the same meaning as in <a class="reference internal" href="../library/stdtypes.html#str.encode" title="str.encode"><code class="xref py py-func docutils literal notranslate"><span class="pre">str.encode()</span></code></a>.</p> <p>For stderr, the <code class="docutils literal notranslate"><span class="pre">:errorhandler</span></code> part is ignored; the handler will always be <code class="docutils literal notranslate"><span class="pre">'backslashreplace'</span></code>.</p> <div class="versionchanged"> <p><span class="versionmodified changed">Changed in version 3.4: </span>The <code class="docutils literal notranslate"><span class="pre">encodingname</span></code> part is now optional.</p> </div> <div class="versionchanged"> <p><span class="versionmodified changed">Changed in version 3.6: </span>On Windows, the encoding specified by this variable is ignored for interactive console buffers unless <span class="target" id="index-34"></span><a class="reference internal" href="#envvar-PYTHONLEGACYWINDOWSSTDIO"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">PYTHONLEGACYWINDOWSSTDIO</span></code></a> is also specified. Files and pipes redirected through the standard streams are not affected.</p> </div> </dd></dl> <dl class="std envvar"> <dt class="sig sig-object std" id="envvar-PYTHONNOUSERSITE"> <span class="sig-name descname"><span class="pre">PYTHONNOUSERSITE</span></span><a class="headerlink" href="#envvar-PYTHONNOUSERSITE" title="Permalink to this definition">¶</a></dt> <dd><p>If this is set, Python won’t add the <a class="reference internal" href="../library/site.html#site.USER_SITE" title="site.USER_SITE"><code class="xref py py-data docutils literal notranslate"><span class="pre">user</span> <span class="pre">site-packages</span> <span class="pre">directory</span></code></a> to <a class="reference internal" href="../library/sys.html#sys.path" title="sys.path"><code class="xref py py-data docutils literal notranslate"><span class="pre">sys.path</span></code></a>.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><span class="target" id="index-35"></span><a class="pep reference external" href="https://www.python.org/dev/peps/pep-0370"><strong>PEP 370</strong></a> – Per user site-packages directory</p> </div> </dd></dl> <dl class="std envvar"> <dt class="sig sig-object std" id="envvar-PYTHONUSERBASE"> <span class="sig-name descname"><span class="pre">PYTHONUSERBASE</span></span><a class="headerlink" href="#envvar-PYTHONUSERBASE" title="Permalink to this definition">¶</a></dt> <dd><p>Defines the <a class="reference internal" href="../library/site.html#site.USER_BASE" title="site.USER_BASE"><code class="xref py py-data docutils literal notranslate"><span class="pre">user</span> <span class="pre">base</span> <span class="pre">directory</span></code></a>, which is used to compute the path of the <a class="reference internal" href="../library/site.html#site.USER_SITE" title="site.USER_SITE"><code class="xref py py-data docutils literal notranslate"><span class="pre">user</span> <span class="pre">site-packages</span> <span class="pre">directory</span></code></a> and <a class="reference internal" href="../install/index.html#inst-alt-install-user"><span class="std std-ref">Distutils installation paths</span></a> for <code class="docutils literal notranslate"><span class="pre">python</span> <span class="pre">setup.py</span> <span class="pre">install</span> <span class="pre">--user</span></code>.</p> <div class="admonition seealso"> <p class="admonition-title">See also</p> <p><span class="target" id="index-36"></span><a class="pep reference external" href="https://www.python.org/dev/peps/pep-0370"><strong>PEP 370</strong></a> – Per user site-packages directory</p> </div> </dd></dl> <dl class="std envvar"> <dt class="sig sig-object std" id="envvar-PYTHONEXECUTABLE"> <span class="sig-name descname"><span class="pre">PYTHONEXECUTABLE</span></span><a class="headerlink" href="#envvar-PYTHONEXECUTABLE" title="Permalink to this definition">¶</a></dt> <dd><p>If this environment variable is set, <code class="docutils literal notranslate"><span class="pre">sys.argv[0]</span></code> will be set to its value instead of the value got through the C runtime. Only works on macOS.</p> </dd></dl> <dl class="std envvar"> <dt class="sig sig-object std" id="envvar-PYTHONWARNINGS"> <span class="sig-name descname"><span class="pre">PYTHONWARNINGS</span></span><a class="headerlink" href="#envvar-PYTHONWARNINGS" title="Permalink to this definition">¶</a></dt> <dd><p>This is equivalent to the <a class="reference internal" href="#cmdoption-W"><code class="xref std std-option docutils literal notranslate"><span class="pre">-W</span></code></a> option. If set to a comma separated string, it is equivalent to specifying <a class="reference internal" href="#cmdoption-W"><code class="xref std std-option docutils literal notranslate"><span class="pre">-W</span></code></a> multiple times, with filters later in the list taking precedence over those earlier in the list.</p> <p>The simplest settings apply a particular action unconditionally to all warnings emitted by a process (even those that are otherwise ignored by default):</p> <div class="highlight-sh notranslate"><div class="highlight"><pre><span></span><span class="nv">PYTHONWARNINGS</span><span class="o">=</span>default <span class="c1"># Warn once per call location</span> <span class="nv">PYTHONWARNINGS</span><span class="o">=</span>error <span class="c1"># Convert to exceptions</span> <span class="nv">PYTHONWARNINGS</span><span class="o">=</span>always <span class="c1"># Warn every time</span> <span class="nv">PYTHONWARNINGS</span><span class="o">=</span>module <span class="c1"># Warn once per calling module</span> <span class="nv">PYTHONWARNINGS</span><span class="o">=</span>once <span class="c1"># Warn once per Python process</span> <span class="nv">PYTHONWARNINGS</span><span class="o">=</span>ignore <span class="c1"># Never warn</span> </pre></div> </div> <p>See <a class="reference internal" href="../library/warnings.html#warning-filter"><span class="std std-ref">The Warnings Filter</span></a> and <a class="reference internal" href="../library/warnings.html#describing-warning-filters"><span class="std std-ref">Describing Warning Filters</span></a> for more details.</p> </dd></dl> <dl class="std envvar"> <dt class="sig sig-object std" id="envvar-PYTHONFAULTHANDLER"> <span class="sig-name descname"><span class="pre">PYTHONFAULTHANDLER</span></span><a class="headerlink" href="#envvar-PYTHONFAULTHANDLER" title="Permalink to this definition">¶</a></dt> <dd><p>If this environment variable is set to a non-empty string, <a class="reference internal" href="../library/faulthandler.html#faulthandler.enable" title="faulthandler.enable"><code class="xref py py-func docutils literal notranslate"><span class="pre">faulthandler.enable()</span></code></a> is called at startup: install a handler for <code class="xref py py-const docutils literal notranslate"><span class="pre">SIGSEGV</span></code>, <code class="xref py py-const docutils literal notranslate"><span class="pre">SIGFPE</span></code>, <code class="xref py py-const docutils literal notranslate"><span class="pre">SIGABRT</span></code>, <code class="xref py py-const docutils literal notranslate"><span class="pre">SIGBUS</span></code> and <code class="xref py py-const docutils literal notranslate"><span class="pre">SIGILL</span></code> signals to dump the Python traceback. This is equivalent to <a class="reference internal" href="#cmdoption-X"><code class="xref std std-option docutils literal notranslate"><span class="pre">-X</span></code></a> <code class="docutils literal notranslate"><span class="pre">faulthandler</span></code> option.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.3.</span></p> </div> </dd></dl> <dl class="std envvar"> <dt class="sig sig-object std" id="envvar-PYTHONTRACEMALLOC"> <span class="sig-name descname"><span class="pre">PYTHONTRACEMALLOC</span></span><a class="headerlink" href="#envvar-PYTHONTRACEMALLOC" title="Permalink to this definition">¶</a></dt> <dd><p>If this environment variable is set to a non-empty string, start tracing Python memory allocations using the <a class="reference internal" href="../library/tracemalloc.html#module-tracemalloc" title="tracemalloc: Trace memory allocations."><code class="xref py py-mod docutils literal notranslate"><span class="pre">tracemalloc</span></code></a> module. The value of the variable is the maximum number of frames stored in a traceback of a trace. For example, <code class="docutils literal notranslate"><span class="pre">PYTHONTRACEMALLOC=1</span></code> stores only the most recent frame. See the <a class="reference internal" href="../library/tracemalloc.html#tracemalloc.start" title="tracemalloc.start"><code class="xref py py-func docutils literal notranslate"><span class="pre">tracemalloc.start()</span></code></a> for more information.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.4.</span></p> </div> </dd></dl> <dl class="std envvar"> <dt class="sig sig-object std" id="envvar-PYTHONPROFILEIMPORTTIME"> <span class="sig-name descname"><span class="pre">PYTHONPROFILEIMPORTTIME</span></span><a class="headerlink" href="#envvar-PYTHONPROFILEIMPORTTIME" title="Permalink to this definition">¶</a></dt> <dd><p>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 <code class="docutils literal notranslate"><span class="pre">-X</span> <span class="pre">importtime</span></code> on the command line.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.7.</span></p> </div> </dd></dl> <dl class="std envvar"> <dt class="sig sig-object std" id="envvar-PYTHONASYNCIODEBUG"> <span class="sig-name descname"><span class="pre">PYTHONASYNCIODEBUG</span></span><a class="headerlink" href="#envvar-PYTHONASYNCIODEBUG" title="Permalink to this definition">¶</a></dt> <dd><p>If this environment variable is set to a non-empty string, enable the <a class="reference internal" href="../library/asyncio-dev.html#asyncio-debug-mode"><span class="std std-ref">debug mode</span></a> of the <a class="reference internal" href="../library/asyncio.html#module-asyncio" title="asyncio: Asynchronous I/O."><code class="xref py py-mod docutils literal notranslate"><span class="pre">asyncio</span></code></a> module.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.4.</span></p> </div> </dd></dl> <dl class="std envvar"> <dt class="sig sig-object std" id="envvar-PYTHONMALLOC"> <span class="sig-name descname"><span class="pre">PYTHONMALLOC</span></span><a class="headerlink" href="#envvar-PYTHONMALLOC" title="Permalink to this definition">¶</a></dt> <dd><p>Set the Python memory allocators and/or install debug hooks.</p> <p>Set the family of memory allocators used by Python:</p> <ul class="simple"> <li><p><code class="docutils literal notranslate"><span class="pre">default</span></code>: use the <a class="reference internal" href="../c-api/memory.html#default-memory-allocators"><span class="std std-ref">default memory allocators</span></a>.</p></li> <li><p><code class="docutils literal notranslate"><span class="pre">malloc</span></code>: use the <code class="xref c c-func docutils literal notranslate"><span class="pre">malloc()</span></code> function of the C library for all domains (<code class="xref c c-data docutils literal notranslate"><span class="pre">PYMEM_DOMAIN_RAW</span></code>, <code class="xref c c-data docutils literal notranslate"><span class="pre">PYMEM_DOMAIN_MEM</span></code>, <code class="xref c c-data docutils literal notranslate"><span class="pre">PYMEM_DOMAIN_OBJ</span></code>).</p></li> <li><p><code class="docutils literal notranslate"><span class="pre">pymalloc</span></code>: use the <a class="reference internal" href="../c-api/memory.html#pymalloc"><span class="std std-ref">pymalloc allocator</span></a> for <code class="xref c c-data docutils literal notranslate"><span class="pre">PYMEM_DOMAIN_MEM</span></code> and <code class="xref c c-data docutils literal notranslate"><span class="pre">PYMEM_DOMAIN_OBJ</span></code> domains and use the <code class="xref c c-func docutils literal notranslate"><span class="pre">malloc()</span></code> function for the <code class="xref c c-data docutils literal notranslate"><span class="pre">PYMEM_DOMAIN_RAW</span></code> domain.</p></li> </ul> <p>Install <a class="reference internal" href="../c-api/memory.html#pymem-debug-hooks"><span class="std std-ref">debug hooks</span></a>:</p> <ul class="simple"> <li><p><code class="docutils literal notranslate"><span class="pre">debug</span></code>: install debug hooks on top of the <a class="reference internal" href="../c-api/memory.html#default-memory-allocators"><span class="std std-ref">default memory allocators</span></a>.</p></li> <li><p><code class="docutils literal notranslate"><span class="pre">malloc_debug</span></code>: same as <code class="docutils literal notranslate"><span class="pre">malloc</span></code> but also install debug hooks.</p></li> <li><p><code class="docutils literal notranslate"><span class="pre">pymalloc_debug</span></code>: same as <code class="docutils literal notranslate"><span class="pre">pymalloc</span></code> but also install debug hooks.</p></li> </ul> <div class="versionchanged"> <p><span class="versionmodified changed">Changed in version 3.7: </span>Added the <code class="docutils literal notranslate"><span class="pre">"default"</span></code> allocator.</p> </div> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.6.</span></p> </div> </dd></dl> <dl class="std envvar"> <dt class="sig sig-object std" id="envvar-PYTHONMALLOCSTATS"> <span class="sig-name descname"><span class="pre">PYTHONMALLOCSTATS</span></span><a class="headerlink" href="#envvar-PYTHONMALLOCSTATS" title="Permalink to this definition">¶</a></dt> <dd><p>If set to a non-empty string, Python will print statistics of the <a class="reference internal" href="../c-api/memory.html#pymalloc"><span class="std std-ref">pymalloc memory allocator</span></a> every time a new pymalloc object arena is created, and on shutdown.</p> <p>This variable is ignored if the <span class="target" id="index-37"></span><a class="reference internal" href="#envvar-PYTHONMALLOC"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">PYTHONMALLOC</span></code></a> environment variable is used to force the <code class="xref c c-func docutils literal notranslate"><span class="pre">malloc()</span></code> allocator of the C library, or if Python is configured without <code class="docutils literal notranslate"><span class="pre">pymalloc</span></code> support.</p> <div class="versionchanged"> <p><span class="versionmodified changed">Changed in version 3.6: </span>This variable can now also be used on Python compiled in release mode. It now has no effect if set to an empty string.</p> </div> </dd></dl> <dl class="std envvar"> <dt class="sig sig-object std" id="envvar-PYTHONLEGACYWINDOWSFSENCODING"> <span class="sig-name descname"><span class="pre">PYTHONLEGACYWINDOWSFSENCODING</span></span><a class="headerlink" href="#envvar-PYTHONLEGACYWINDOWSFSENCODING" title="Permalink to this definition">¶</a></dt> <dd><p>If set to a non-empty string, the default <a class="reference internal" href="../glossary.html#term-filesystem-encoding-and-error-handler"><span class="xref std std-term">filesystem encoding and error handler</span></a> mode will revert to their pre-3.6 values of ‘mbcs’ and ‘replace’, respectively. Otherwise, the new defaults ‘utf-8’ and ‘surrogatepass’ are used.</p> <p>This may also be enabled at runtime with <a class="reference internal" href="../library/sys.html#sys._enablelegacywindowsfsencoding" title="sys._enablelegacywindowsfsencoding"><code class="xref py py-func docutils literal notranslate"><span class="pre">sys._enablelegacywindowsfsencoding()</span></code></a>.</p> <p class="availability"><a class="reference internal" href="../library/intro.html#availability"><span class="std std-ref">Availability</span></a>: Windows.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.6: </span>See <span class="target" id="index-38"></span><a class="pep reference external" href="https://www.python.org/dev/peps/pep-0529"><strong>PEP 529</strong></a> for more details.</p> </div> </dd></dl> <dl class="std envvar"> <dt class="sig sig-object std" id="envvar-PYTHONLEGACYWINDOWSSTDIO"> <span class="sig-name descname"><span class="pre">PYTHONLEGACYWINDOWSSTDIO</span></span><a class="headerlink" href="#envvar-PYTHONLEGACYWINDOWSSTDIO" title="Permalink to this definition">¶</a></dt> <dd><p>If set to a non-empty string, does not use the new console reader and writer. This means that Unicode characters will be encoded according to the active console code page, rather than using utf-8.</p> <p>This variable is ignored if the standard streams are redirected (to files or pipes) rather than referring to console buffers.</p> <p class="availability"><a class="reference internal" href="../library/intro.html#availability"><span class="std std-ref">Availability</span></a>: Windows.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.6.</span></p> </div> </dd></dl> <dl class="std envvar"> <dt class="sig sig-object std" id="envvar-PYTHONCOERCECLOCALE"> <span class="sig-name descname"><span class="pre">PYTHONCOERCECLOCALE</span></span><a class="headerlink" href="#envvar-PYTHONCOERCECLOCALE" title="Permalink to this definition">¶</a></dt> <dd><p>If set to the value <code class="docutils literal notranslate"><span class="pre">0</span></code>, causes the main Python command line application to skip coercing the legacy ASCII-based C and POSIX locales to a more capable UTF-8 based alternative.</p> <p>If this variable is <em>not</em> set (or is set to a value other than <code class="docutils literal notranslate"><span class="pre">0</span></code>), the <code class="docutils literal notranslate"><span class="pre">LC_ALL</span></code> locale override environment variable is also not set, and the current locale reported for the <code class="docutils literal notranslate"><span class="pre">LC_CTYPE</span></code> category is either the default <code class="docutils literal notranslate"><span class="pre">C</span></code> locale, or else the explicitly ASCII-based <code class="docutils literal notranslate"><span class="pre">POSIX</span></code> locale, then the Python CLI will attempt to configure the following locales for the <code class="docutils literal notranslate"><span class="pre">LC_CTYPE</span></code> category in the order listed before loading the interpreter runtime:</p> <ul class="simple"> <li><p><code class="docutils literal notranslate"><span class="pre">C.UTF-8</span></code></p></li> <li><p><code class="docutils literal notranslate"><span class="pre">C.utf8</span></code></p></li> <li><p><code class="docutils literal notranslate"><span class="pre">UTF-8</span></code></p></li> </ul> <p>If setting one of these locale categories succeeds, then the <code class="docutils literal notranslate"><span class="pre">LC_CTYPE</span></code> environment variable will also be set accordingly in the current process environment before the Python runtime is initialized. This ensures that in addition to being seen by both the interpreter itself and other locale-aware components running in the same process (such as the GNU <code class="docutils literal notranslate"><span class="pre">readline</span></code> 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 <a class="reference internal" href="../library/locale.html#locale.getdefaultlocale" title="locale.getdefaultlocale"><code class="xref py py-func docutils literal notranslate"><span class="pre">locale.getdefaultlocale()</span></code></a>).</p> <p>Configuring one of these locales (either explicitly or via the above implicit locale coercion) automatically enables the <code class="docutils literal notranslate"><span class="pre">surrogateescape</span></code> <a class="reference internal" href="../library/codecs.html#error-handlers"><span class="std std-ref">error handler</span></a> for <a class="reference internal" href="../library/sys.html#sys.stdin" title="sys.stdin"><code class="xref py py-data docutils literal notranslate"><span class="pre">sys.stdin</span></code></a> and <a class="reference internal" href="../library/sys.html#sys.stdout" title="sys.stdout"><code class="xref py py-data docutils literal notranslate"><span class="pre">sys.stdout</span></code></a> (<a class="reference internal" href="../library/sys.html#sys.stderr" title="sys.stderr"><code class="xref py py-data docutils literal notranslate"><span class="pre">sys.stderr</span></code></a> continues to use <code class="docutils literal notranslate"><span class="pre">backslashreplace</span></code> as it does in any other locale). This stream handling behavior can be overridden using <span class="target" id="index-39"></span><a class="reference internal" href="#envvar-PYTHONIOENCODING"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">PYTHONIOENCODING</span></code></a> as usual.</p> <p>For debugging purposes, setting <code class="docutils literal notranslate"><span class="pre">PYTHONCOERCECLOCALE=warn</span></code> will cause Python to emit warning messages on <code class="docutils literal notranslate"><span class="pre">stderr</span></code> if either the locale coercion activates, or else if a locale that <em>would</em> have triggered coercion is still active when the Python runtime is initialized.</p> <p>Also note that even when locale coercion is disabled, or when it fails to find a suitable target locale, <span class="target" id="index-40"></span><a class="reference internal" href="#envvar-PYTHONUTF8"><code class="xref std std-envvar docutils literal notranslate"><span class="pre">PYTHONUTF8</span></code></a> will still activate by default in legacy ASCII-based locales. Both features must be disabled in order to force the interpreter to use <code class="docutils literal notranslate"><span class="pre">ASCII</span></code> instead of <code class="docutils literal notranslate"><span class="pre">UTF-8</span></code> for system interfaces.</p> <p class="availability"><a class="reference internal" href="../library/intro.html#availability"><span class="std std-ref">Availability</span></a>: *nix.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.7: </span>See <span class="target" id="index-41"></span><a class="pep reference external" href="https://www.python.org/dev/peps/pep-0538"><strong>PEP 538</strong></a> for more details.</p> </div> </dd></dl> <dl class="std envvar"> <dt class="sig sig-object std" id="envvar-PYTHONDEVMODE"> <span class="sig-name descname"><span class="pre">PYTHONDEVMODE</span></span><a class="headerlink" href="#envvar-PYTHONDEVMODE" title="Permalink to this definition">¶</a></dt> <dd><p>If this environment variable is set to a non-empty string, enable <a class="reference internal" href="../library/devmode.html#devmode"><span class="std std-ref">Python Development Mode</span></a>, introducing additional runtime checks that are too expensive to be enabled by default.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.7.</span></p> </div> </dd></dl> <dl class="std envvar"> <dt class="sig sig-object std" id="envvar-PYTHONUTF8"> <span class="sig-name descname"><span class="pre">PYTHONUTF8</span></span><a class="headerlink" href="#envvar-PYTHONUTF8" title="Permalink to this definition">¶</a></dt> <dd><p>If set to <code class="docutils literal notranslate"><span class="pre">1</span></code>, enable the <a class="reference internal" href="../library/os.html#utf8-mode"><span class="std std-ref">Python UTF-8 Mode</span></a>.</p> <p>If set to <code class="docutils literal notranslate"><span class="pre">0</span></code>, disable the <a class="reference internal" href="../library/os.html#utf8-mode"><span class="std std-ref">Python UTF-8 Mode</span></a>.</p> <p>Setting any other non-empty string causes an error during interpreter initialisation.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.7.</span></p> </div> </dd></dl> <dl class="std envvar"> <dt class="sig sig-object std" id="envvar-PYTHONWARNDEFAULTENCODING"> <span class="sig-name descname"><span class="pre">PYTHONWARNDEFAULTENCODING</span></span><a class="headerlink" href="#envvar-PYTHONWARNDEFAULTENCODING" title="Permalink to this definition">¶</a></dt> <dd><p>If this environment variable is set to a non-empty string, issue a <a class="reference internal" href="../library/exceptions.html#EncodingWarning" title="EncodingWarning"><code class="xref py py-class docutils literal notranslate"><span class="pre">EncodingWarning</span></code></a> when the locale-specific default encoding is used.</p> <p>See <a class="reference internal" href="../library/io.html#io-encoding-warning"><span class="std std-ref">Opt-in EncodingWarning</span></a> for details.</p> <div class="versionadded"> <p><span class="versionmodified added">New in version 3.10.</span></p> </div> </dd></dl> <section id="debug-mode-variables"> <h3><span class="section-number">1.2.1. </span>Debug-mode variables<a class="headerlink" href="#debug-mode-variables" title="Permalink to this headline">¶</a></h3> <dl class="std envvar"> <dt class="sig sig-object std" id="envvar-PYTHONTHREADDEBUG"> <span class="sig-name descname"><span class="pre">PYTHONTHREADDEBUG</span></span><a class="headerlink" href="#envvar-PYTHONTHREADDEBUG" title="Permalink to this definition">¶</a></dt> <dd><p>If set, Python will print threading debug info into stdout.</p> <p>Need a <a class="reference internal" href="configure.html#debug-build"><span class="std std-ref">debug build of Python</span></a>.</p> <div class="deprecated-removed"> <p><span class="versionmodified">Deprecated since version 3.10, will be removed in version 3.12.</span></p> </div> </dd></dl> <dl class="std envvar"> <dt class="sig sig-object std" id="envvar-PYTHONDUMPREFS"> <span class="sig-name descname"><span class="pre">PYTHONDUMPREFS</span></span><a class="headerlink" href="#envvar-PYTHONDUMPREFS" title="Permalink to this definition">¶</a></dt> <dd><p>If set, Python will dump objects and reference counts still alive after shutting down the interpreter.</p> <p>Need Python configured with the <a class="reference internal" href="configure.html#cmdoption-with-trace-refs"><code class="xref std std-option docutils literal notranslate"><span class="pre">--with-trace-refs</span></code></a> build option.</p> </dd></dl> </section> </section> </section> <div class="clearer"></div> </div> </div> </div> <div class="sphinxsidebar" role="navigation" aria-label="main navigation"> <div class="sphinxsidebarwrapper"> <h3><a href="../contents.html">Table of Contents</a></h3> <ul> <li><a class="reference internal" href="#">1. Command line and environment</a><ul> <li><a class="reference internal" href="#command-line">1.1. Command line</a><ul> <li><a class="reference internal" href="#interface-options">1.1.1. Interface options</a></li> <li><a class="reference internal" href="#generic-options">1.1.2. Generic options</a></li> <li><a class="reference internal" href="#miscellaneous-options">1.1.3. Miscellaneous options</a></li> <li><a class="reference internal" href="#options-you-shouldn-t-use">1.1.4. Options you shouldn’t use</a></li> </ul> </li> <li><a class="reference internal" href="#environment-variables">1.2. Environment variables</a><ul> <li><a class="reference internal" href="#debug-mode-variables">1.2.1. Debug-mode variables</a></li> </ul> </li> </ul> </li> </ul> <h4>Previous topic</h4> <p class="topless"><a href="index.html" title="previous chapter">Python Setup and Usage</a></p> <h4>Next topic</h4> <p class="topless"><a href="unix.html" title="next chapter"><span class="section-number">2. </span>Using Python on Unix platforms</a></p> <div role="note" aria-label="source link"> <h3>This Page</h3> <ul class="this-page-menu"> <li><a href="../bugs.html">Report a Bug</a></li> <li> <a href="https://github.com/python/cpython/blob/3.10/Doc/using/cmdline.rst" rel="nofollow">Show Source </a> </li> </ul> </div> </div> </div> <div class="clearer"></div> </div> <div class="related" role="navigation" aria-label="related navigation"> <h3>Navigation</h3> <ul> <li class="right" style="margin-right: 10px"> <a href="../genindex.html" title="General Index" >index</a></li> <li class="right" > <a href="../py-modindex.html" title="Python Module Index" >modules</a> |</li> <li class="right" > <a href="unix.html" title="2. Using Python on Unix platforms" >next</a> |</li> <li class="right" > <a href="index.html" title="Python Setup and Usage" >previous</a> |</li> <li><img src="../_static/py.svg" alt="python logo" style="vertical-align: middle; margin-top: -1px"/></li> <li><a href="https://www.python.org/">Python</a> »</li> <li class="switchers"> <div class="language_switcher_placeholder"></div> <div class="version_switcher_placeholder"></div> </li> <li> </li> <li id="cpython-language-and-version"> <a href="../index.html">3.10.12 Documentation</a> » </li> <li class="nav-item nav-item-1"><a href="index.html" >Python Setup and Usage</a> »</li> <li class="nav-item nav-item-this"><a href=""><span class="section-number">1. </span>Command line and environment</a></li> <li class="right"> <div class="inline-search" role="search"> <form class="inline-search" action="../search.html" method="get"> <input placeholder="Quick search" aria-label="Quick search" type="text" name="q" /> <input type="submit" value="Go" /> <input type="hidden" name="check_keywords" value="yes" /> <input type="hidden" name="area" value="default" /> </form> </div> | </li> </ul> </div> <div class="footer"> © <a href="../copyright.html">Copyright</a> 2001-2025, Python Software Foundation. <br /> This page is licensed under the Python Software Foundation License Version 2. <br /> Examples, recipes, and other code in the documentation are additionally licensed under the Zero Clause BSD License. <br /> See <a href="/license.html">History and License</a> for more information.<br /> <br /> The Python Software Foundation is a non-profit corporation. <a href="https://www.python.org/psf/donations/">Please donate.</a> <br /> <br /> Last updated on November 04, 2025. <a href="/bugs.html">Found a bug</a>? <br /> Created using <a href="https://www.sphinx-doc.org/">Sphinx</a> 4.3.2. </div> </body> </html>
Edit
Rename
Chmod
Delete
FILE
FOLDER
Name
Size
Permission
Action
cmdline.html
110279 bytes
0644
configure.html
102940 bytes
0644
editors.html
10817 bytes
0644
index.html
21465 bytes
0644
mac.html
24388 bytes
0644
unix.html
25174 bytes
0644
windows.html
106758 bytes
0644
N4ST4R_ID | Naxtarrr