{
    "mode": "info",
    "parameter": "PYTHON",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/info/PYTHON/json",
    "generated": "2026-07-05T23:45:00Z",
    "synopsis": "python [ -B ] [ -b ] [ -d ] [ -E ] [ -h ] [ -i ] [ -I ]\n[ -m module-name ] [ -q ] [ -O ] [ -OO ] [ -s ] [ -S ] [ -u ]\n[ -v ] [ -V ] [ -W argument ] [ -x ] [ -X option ] [ -?  ]\n[ --check-hash-based-pycs default | always | never ]\n[ -c command | script | - ] [ arguments ]",
    "sections": {
        "NAME": {
            "content": "python  - an interpreted, interactive, object-oriented programming lan-\nguage\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "python [ -B ] [ -b ] [ -d ] [ -E ] [ -h ] [ -i ] [ -I ]\n[ -m module-name ] [ -q ] [ -O ] [ -OO ] [ -s ] [ -S ] [ -u ]\n[ -v ] [ -V ] [ -W argument ] [ -x ] [ -X option ] [ -?  ]\n[ --check-hash-based-pycs default | always | never ]\n[ -c command | script | - ] [ arguments ]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Python is an interpreted, interactive, object-oriented programming lan-\nguage  that  combines  remarkable power with very clear syntax.  For an\nintroduction to programming in Python, see the  Python  Tutorial.   The\nPython  Library  Reference  documents built-in and standard types, con-\nstants, functions and modules.  Finally, the  Python  Reference  Manual\ndescribes  the  syntax  and  semantics of the core language in (perhaps\ntoo) much detail.  (These documents may be located via the INTERNET RE-\nSOURCES below; they may be installed on your system as well.)\n\nPython's basic power can be extended with your own modules written in C\nor C++.  On most  systems  such  modules  may  be  dynamically  loaded.\nPython is also adaptable as an extension language for existing applica-\ntions.  See the internal documentation for hints.\n\nDocumentation for installed Python modules and packages can  be  viewed\nby running the pydoc program.\n",
            "subsections": []
        },
        "COMMAND LINE OPTIONS": {
            "content": "-B     Don't  write .pyc files on import. See also PYTHONDONTWRITEBYTE-\nCODE.\n\n-b     Issue  warnings  about  str(bytesinstance),   str(bytearrayin-\nstance)  and comparing bytes/bytearray with str. (-bb: issue er-\nrors)\n\n-c command\nSpecify the command to execute (see next section).  This  termi-\nnates the option list (following options are passed as arguments\nto the command).\n\n--check-hash-based-pycs mode\nConfigure how Python evaluates the up-to-dateness of  hash-based\n.pyc files.\n\n-d     Turn  on  parser debugging output (for expert only, depending on\ncompilation options).\n\n-E     Ignore environment variables like PYTHONPATH and PYTHONHOME that\nmodify the behavior of the interpreter.\n\n-h ,  -? ,  --help\nPrints the usage for the interpreter executable and exits.\n\n-i     When  a  script  is passed as first argument or the -c option is\nused, enter interactive mode after executing the script  or  the\ncommand.  It does not read the $PYTHONSTARTUP file.  This can be\nuseful to inspect global variables  or  a  stack  trace  when  a\nscript raises an exception.\n\n-I     Run  Python  in  isolated  mode. This also implies -E and -s. In\nisolated mode sys.path contains neither the  script's  directory\nnor  the user's site-packages directory. All PYTHON* environment\nvariables are ignored, too.  Further restrictions may be imposed\nto prevent the user from injecting malicious code.\n\n-m module-name\nSearches  sys.path for the named module and runs the correspond-\ning .py file as a script. This terminates the option list  (fol-\nlowing options are passed as arguments to the module).\n\n-O     Remove  assert  statements and any code conditional on the value\nof debug; augment the filename for compiled (bytecode) files\nby adding .opt-1 before the .pyc extension.\n\n-OO    Do  -O and also discard docstrings; change the filename for com-\npiled (bytecode) files by adding .opt-2 before the  .pyc  exten-\nsion.\n\n-q     Do  not print the version and copyright messages. These messages\nare also suppressed in non-interactive mode.\n\n-s     Don't add user site directory to sys.path.\n\n-S     Disable the import of the module site and the site-dependent ma-\nnipulations of sys.path that it entails.  Also disable these ma-\nnipulations if site is explicitly imported later.\n\n-u     Force the stdout and stderr streams to be unbuffered.  This  op-\ntion has no effect on the stdin stream.\n\n-v     Print  a  message each time a module is initialized, showing the\nplace (filename or built-in module) from  which  it  is  loaded.\nWhen  given twice, print a message for each file that is checked\nfor when searching for a module.  Also provides  information  on\nmodule cleanup at exit.\n",
            "subsections": [
                {
                    "name": "-V ,  --version",
                    "content": "Prints  the  Python  version number of the executable and exits.\nWhen given twice, print more information about the build.\n\n-W argument\nWarning control. Python's warning machinery  by  default  prints\nwarning messages to sys.stderr.\n\nThe  simplest settings apply a particular action unconditionally\nto all warnings emitted by a process (even those that are other-\nwise ignored by default):\n\n-Wdefault  # Warn once per call location\n-Werror    # Convert to exceptions\n-Walways   # Warn every time\n-Wmodule   # Warn once per calling module\n-Wonce     # Warn once per Python process\n-Wignore   # Never warn\n\nThe  action  names  can be abbreviated as desired and the inter-\npreter will resolve them to the appropriate action name. For ex-\nample, -Wi is the same as -Wignore .\n\nThe  full  form  of  argument  is:  action:message:category:mod-\nule:lineno\n\nEmpty fields match all values;  trailing  empty  fields  may  be\nomitted.  For  example -W ignore::DeprecationWarning ignores all\nDeprecationWarning warnings.\n\nThe action field is as explained above but only applies to warn-\nings that match the remaining fields.\n\nThe  message field must match the whole printed warning message;\nthis match is case-insensitive.\n\nThe category field matches the warning category  (ex:  \"Depreca-\ntionWarning\"). This must be a class name; the match test whether\nthe actual warning category of the message is a subclass of  the\nspecified warning category.\n\nThe module field matches the (fully-qualified) module name; this\nmatch is case-sensitive.\n\nThe lineno field matches the line number, where zero matches all\nline numbers and is thus equivalent to an omitted line number.\n\nMultiple  -W  options  can be given; when a warning matches more\nthan one option, the action for the last matching option is per-\nformed.  Invalid  -W options are ignored (though, a warning mes-\nsage is printed about invalid options when the first warning  is\nissued).\n\nWarnings  can  also be controlled using the PYTHONWARNINGS envi-\nronment variable and from within  a  Python  program  using  the\nwarnings  module.   For  example,  the warnings.filterwarnings()\nfunction can be used to use a regular expression on the  warning\nmessage.\n\n-X option\nSet  implementation  specific  option. The following options are\navailable:\n\n-X faulthandler: enable faulthandler\n\n-X showrefcount: output the total reference count and number\nof used\nmemory  blocks  when  the program finishes or after each\nstatement in the\ninteractive interpreter. This only works on debug builds\n\n-X tracemalloc: start tracing Python memory allocations  us-\ning the\ntracemalloc  module.  By  default,  only the most recent\nframe is stored in a\ntraceback of a trace. Use -X tracemalloc=NFRAME to start\ntracing with a\ntraceback limit of NFRAME frames\n\n-X  importtime:  show  how  long each import takes. It shows\nmodule name,\ncumulative time (including nested imports) and self time\n(excluding\nnested  imports).  Note that its output may be broken in\nmulti-threaded\napplication. Typical usage is python3 -X  importtime  -c\n'import asyncio'\n\n-X dev: enable CPython's \"development mode\", introducing ad-\nditional runtime\nchecks which are too expensive to be enabled by default.\nIt will not be\nmore  verbose  than  the default if the code is correct:\nnew warnings are\nonly emitted when an issue is detected.  Effect  of  the\ndeveloper mode:\n* Add default warning filter, as -W default\n*  Install  debug hooks on memory allocators: see the\nPyMemSetupDebugHooks()\nC function\n* Enable the faulthandler module to dump  the  Python\ntraceback on a crash\n* Enable asyncio debug mode\n* Set the devmode attribute of sys.flags to True\n* io.IOBase destructor logs close() exceptions\n\n-X  utf8: enable UTF-8 mode for operating system interfaces,\noverriding the default\nlocale-aware mode. -X utf8=0 explicitly  disables  UTF-8\nmode (even when it would\notherwise  activate  automatically).  See PYTHONUTF8 for\nmore details\n\n-X pycacheprefix=PATH: enable writing .pyc files to a  par-\nallel tree rooted at the\ngiven directory instead of to the code tree.\n\n-X  warndefaultencoding: enable opt-in EncodingWarning for\n'encoding=None'\n\n-X intmaxstrdigits=number: limit the  size  of  int<->str\nconversions.\nThis  helps  avoid denial of service attacks when parsing\nuntrusted data.\nThe default  is  sys.intinfo.defaultmaxstrdigits.   0\ndisables.\n\n-x     Skip  the  first line of the source.  This is intended for a DOS\nspecific hack only.  Warning: the line numbers in error messages\nwill be off by one!\n",
                    "flag": "-V",
                    "long": "--version"
                }
            ]
        },
        "INTERPRETER INTERFACE": {
            "content": "The interpreter interface resembles that of the UNIX shell: when called\nwith standard input connected to a tty device, it prompts for  commands\nand  executes  them  until an EOF is read; when called with a file name\nargument or with a file as standard input,  it  reads  and  executes  a\nscript  from  that  file;  when called with -c command, it executes the\nPython statement(s) given as command.  Here command may contain  multi-\nple  statements  separated by newlines.  Leading whitespace is signifi-\ncant in Python statements!  In non-interactive mode, the  entire  input\nis parsed before it is executed.\n\nIf  available,  the script name and additional arguments thereafter are\npassed to the script in the Python variable sys.argv, which is  a  list\nof  strings (you must first import sys to be able to access it).  If no\nscript name is given, sys.argv[0] is an empty string; if  -c  is  used,\nsys.argv[0] contains the string '-c'.  Note that options interpreted by\nthe Python interpreter itself are not placed in sys.argv.\n\nIn interactive mode, the primary prompt is  `>>>';  the  second  prompt\n(which  appears  when a command is not complete) is `...'.  The prompts\ncan be changed by assignment to sys.ps1 or  sys.ps2.   The  interpreter\nquits  when  it  reads an EOF at a prompt.  When an unhandled exception\noccurs, a stack trace is printed and control  returns  to  the  primary\nprompt;  in  non-interactive mode, the interpreter exits after printing\nthe stack trace.  The interrupt signal raises the KeyboardInterrupt ex-\nception;  other  UNIX  signals  are  not caught (except that SIGPIPE is\nsometimes ignored, in favor of the IOError exception).  Error  messages\nare written to stderr.\n",
            "subsections": []
        },
        "FILES AND DIRECTORIES": {
            "content": "These are subject to difference depending on local installation conven-\ntions; ${prefix}  and  ${execprefix}  are  installation-dependent  and\nshould  be  interpreted  as for GNU software; they may be the same.  On\nDebian GNU/{Hurd,Linux} the default for both is /usr.\n\n${execprefix}/bin/python\nRecommended location of the interpreter.\n\n${prefix}/lib/python<version>\n${execprefix}/lib/python<version>\nRecommended locations of the directories containing the standard\nmodules.\n\n${prefix}/include/python<version>\n${execprefix}/include/python<version>\nRecommended  locations of the directories containing the include\nfiles needed for developing Python extensions and embedding  the\ninterpreter.\n",
            "subsections": []
        },
        "ENVIRONMENT VARIABLES": {
            "content": "PYTHONHOME\nChange  the  location  of the standard Python libraries.  By de-\nfault, the libraries are searched  in  ${prefix}/lib/python<ver-\nsion>  and  ${execprefix}/lib/python<version>,  where ${prefix}\nand ${execprefix} are installation-dependent directories,  both\ndefaulting  to  /usr/local.  When $PYTHONHOME is set to a single\ndirectory, its value replaces both ${prefix} and ${execprefix}.\nTo specify different values for these, set $PYTHONHOME to ${pre-\nfix}:${execprefix}.\n\nPYTHONPATH\nAugments the default search path for module files.   The  format\nis  the  same  as the shell's $PATH: one or more directory path-\nnames  separated  by  colons.   Non-existent   directories   are\nsilently  ignored.   The default search path is installation de-\npendent, but generally begins with ${prefix}/lib/python<version>\n(see  PYTHONHOME  above).  The default search path is always ap-\npended to $PYTHONPATH.  If a script argument is given,  the  di-\nrectory  containing  the script is inserted in the path in front\nof $PYTHONPATH.  The search path can be manipulated from  within\na Python program as the variable sys.path.\n\nPYTHONPLATLIBDIR\nOverride sys.platlibdir.\n\nPYTHONSTARTUP\nIf  this  is the name of a readable file, the Python commands in\nthat file are executed before the first prompt is  displayed  in\ninteractive  mode.   The file is executed in the same name space\nwhere interactive commands are executed so that objects  defined\nor  imported  in it can be used without qualification in the in-\nteractive session.  You can also change the prompts sys.ps1  and\nsys.ps2 in this file.\n\nPYTHONOPTIMIZE\nIf  this is set to a non-empty string it is equivalent to speci-\nfying the -O option. If set to an integer, it is  equivalent  to\nspecifying -O multiple times.\n\nPYTHONDEBUG\nIf  this is set to a non-empty string it is equivalent to speci-\nfying the -d option. If set to an integer, it is  equivalent  to\nspecifying -d multiple times.\n\nPYTHONDONTWRITEBYTECODE\nIf  this is set to a non-empty string it is equivalent to speci-\nfying the -B option (don't try to write .pyc files).\n\nPYTHONINSPECT\nIf this is set to a non-empty string it is equivalent to  speci-\nfying the -i option.\n\nPYTHONIOENCODING\nIf  this is set before running the interpreter, it overrides the\nencoding used for stdin/stdout/stderr, in the  syntax  encoding-\nname:errorhandler  The errorhandler part is optional and has the\nsame meaning as in str.encode. For stderr, the errorhandler\npart is ignored; the handler will always be 'backslashreplace'.\n\nPYTHONNOUSERSITE\nIf this is set to a non-empty string it is equivalent to  speci-\nfying  the  -s  option  (Don't  add  the  user site directory to\nsys.path).\n\nPYTHONUNBUFFERED\nIf this is set to a non-empty string it is equivalent to  speci-\nfying the -u option.\n\nPYTHONVERBOSE\nIf  this is set to a non-empty string it is equivalent to speci-\nfying the -v option. If set to an integer, it is  equivalent  to\nspecifying -v multiple times.\n\nPYTHONWARNINGS\nIf  this  is set to a comma-separated string it is equivalent to\nspecifying the -W option for each separate value.\n\nPYTHONHASHSEED\nIf this variable is set to \"random\", a random value is  used  to\nseed the hashes of str and bytes objects.\n\nIf  PYTHONHASHSEED  is  set to an integer value, it is used as a\nfixed seed for generating the hash() of the types covered by the\nhash randomization.  Its purpose is to allow repeatable hashing,\nsuch as for selftests for the interpreter itself, or to allow  a\ncluster of python processes to share hash values.\n\nThe   integer   must   be   a   decimal   number  in  the  range\n[0,4294967295].  Specifying the value 0 will disable  hash  ran-\ndomization.\n\nPYTHONINTMAXSTRDIGITS\nLimit the maximum digit characters in an int value when convert-\ning from a string and when converting an int back to a  str.   A\nvalue  of 0 disables the limit.  Conversions to or from bases 2,\n4, 8, 16, and 32 are never limited.\n\nPYTHONMALLOC\nSet the Python memory allocators and/or install debug hooks. The\navailable memory allocators are malloc and pymalloc.  The avail-\nable debug hooks are debug, mallocdebug, and pymallocdebug.\n\nWhen Python is compiled in debug mode,  the  default  is  pymal-\nlocdebug and the debug hooks are automatically used. Otherwise,\nthe default is pymalloc.\n\nPYTHONMALLOCSTATS\nIf set to a non-empty string, Python will  print  statistics  of\nthe  pymalloc  memory allocator every time a new pymalloc object\narena is created, and on shutdown.\n\nThis variable is ignored if the $PYTHONMALLOC environment  vari-\nable  is used to force the malloc(3) allocator of the C library,\nor if Python is configured without pymalloc support.\n\nPYTHONASYNCIODEBUG\nIf this environment variable is set to a non-empty  string,  en-\nable the debug mode of the asyncio module.\n\nPYTHONTRACEMALLOC\nIf this environment variable is set to a non-empty string, start\ntracing Python memory allocations using the tracemalloc module.\n\nThe value of the variable is the maximum number of frames stored\nin  a  traceback  of  a  trace. For example, PYTHONTRACEMALLOC=1\nstores only the most recent frame.\n\nPYTHONFAULTHANDLER\nIf this environment variable  is  set  to  a  non-empty  string,\nfaulthandler.enable()  is  called  at startup: install a handler\nfor SIGSEGV, SIGFPE, SIGABRT, SIGBUS and SIGILL signals to  dump\nthe Python traceback.\n\nThis is equivalent to the -X faulthandler option.\n\nPYTHONEXECUTABLE\nIf  this environment variable is set, sys.argv[0] will be set to\nits value instead of the value got through the C  runtime.  Only\nworks on Mac OS X.\n\nPYTHONUSERBASE\nDefines  the  user  base directory, which is used to compute the\npath of the user site-packages directory and Distutils installa-\ntion paths for python setup.py install --user.\n\nPYTHONPROFILEIMPORTTIME\nIf  this  environment  variable  is  set  to a non-empty string,\nPython will show how long each import  takes.  This  is  exactly\nequivalent to setting -X importtime on the command line.\n\nPYTHONBREAKPOINT\nIf  this  environment  variable is set to 0, it disables the de-\nfault debugger. It can be set to the callable of  your  debugger\nof choice.\n\nDebug-mode variables\nSetting  these variables only has an effect in a debug build of Python,\nthat is, if Python was configured with the --with-pydebug build option.\n\nPYTHONTHREADDEBUG\nIf this environment variable is set, Python will print threading\ndebug  info.   The feature is deprecated in Python 3.10 and will\nbe removed in Python 3.12.\n\nPYTHONDUMPREFS\nIf this environment variable is set, Python  will  dump  objects\nand  reference counts still alive after shutting down the inter-\npreter.\n",
            "subsections": []
        },
        "AUTHOR": {
            "content": "The Python Software Foundation: https://www.python.org/psf/\n",
            "subsections": []
        },
        "INTERNET RESOURCES": {
            "content": "Main website:  https://www.python.org/\nDocumentation:  https://docs.python.org/\nDeveloper resources:  https://devguide.python.org/\nDownloads:  https://www.python.org/downloads/\nModule repository:  https://pypi.org/\nNewsgroups:  comp.lang.python, comp.lang.python.announce\n",
            "subsections": []
        },
        "LICENSING": {
            "content": "Python is distributed under an Open Source license.  See the file  \"LI-\nCENSE\"  in  the  Python  source distribution for information on terms &\nconditions for accessing and otherwise using  Python  and  for  a  DIS-\nCLAIMER OF ALL WARRANTIES.\n\nPYTHON(1)",
            "subsections": []
        }
    },
    "summary": "python  - an interpreted, interactive, object-oriented programming lan- guage",
    "flags": [],
    "examples": [],
    "see_also": []
}