{
    "mode": "man",
    "parameter": "python2.7",
    "section": "1",
    "url": "https://www.chedong.com/phpMan.php/man/python2.7/1/json",
    "generated": "2026-06-13T03:49:37Z",
    "synopsis": "python [ -B ] [ -d ] [ -E ] [ -h ] [ -i ] [ -m module-name ]\n[ -O ] [ -OO ] [ -R ] [ -Q argument ] [ -s ] [ -S ] [ -t ] [ -u ]\n[ -v ] [ -V ] [ -W argument ] [ -x ] [ -3 ] [ -?  ]\n[ -c command | script | - ] [ arguments ]",
    "sections": {
        "NAME": {
            "content": "python - an interpreted, interactive, object-oriented programming language\n",
            "subsections": []
        },
        "SYNOPSIS": {
            "content": "python [ -B ] [ -d ] [ -E ] [ -h ] [ -i ] [ -m module-name ]\n[ -O ] [ -OO ] [ -R ] [ -Q argument ] [ -s ] [ -S ] [ -t ] [ -u ]\n[ -v ] [ -V ] [ -W argument ] [ -x ] [ -3 ] [ -?  ]\n[ -c command | script | - ] [ arguments ]\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "Python is an interpreted, interactive, object-oriented programming language that combines re‐\nmarkable power with very clear syntax.  For an introduction to programming in Python, see the\nPython  Tutorial.   The  Python Library Reference documents built-in and standard types, con‐\nstants, functions and modules.  Finally, the Python Reference Manual describes the syntax and\nsemantics of the core language in (perhaps too) much detail.  (These documents may be located\nvia the INTERNET RESOURCES 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 or C++.  On most sys‐\ntems  such  modules may be dynamically loaded.  Python is also adaptable as an extension lan‐\nguage for existing applications.  See the internal documentation for hints.\n\nDocumentation for installed Python modules and packages can be viewed by  running  the  pydoc\nprogram.\n",
            "subsections": []
        },
        "COMMAND LINE OPTIONS": {
            "content": "",
            "subsections": [
                {
                    "name": "-B",
                    "content": "",
                    "flag": "-B"
                },
                {
                    "name": "-c",
                    "content": "Specify  the  command  to execute (see next section).  This terminates the option list\n(following options are passed as arguments to the command).\n",
                    "flag": "-c"
                },
                {
                    "name": "-d",
                    "content": "",
                    "flag": "-d"
                },
                {
                    "name": "-E",
                    "content": "of the interpreter.\n",
                    "flag": "-E"
                },
                {
                    "name": "-h ,  -? ,  --help",
                    "content": "Prints the usage for the interpreter executable and exits.\n",
                    "flag": "-?",
                    "long": "--help"
                },
                {
                    "name": "-i -c",
                    "content": "mode after executing the script or the command.  It does not read  the  $PYTHONSTARTUP\nfile.   This  can be useful to inspect global variables or a stack trace when a script\nraises an exception.\n",
                    "flag": "-c"
                },
                {
                    "name": "-m",
                    "content": "Searches sys.path for the named module and  runs  the  corresponding  .py  file  as  a\nscript.\n",
                    "flag": "-m"
                },
                {
                    "name": "-O",
                    "content": "code) files from .pyc to .pyo.  Given twice, causes docstrings to be discarded.\n",
                    "flag": "-O"
                },
                {
                    "name": "-OO -O",
                    "content": "",
                    "flag": "-O"
                },
                {
                    "name": "-R",
                    "content": "jects  are  \"salted\"  with an unpredictable pseudo-random value.  Although they remain\nconstant within an individual Python process, they are  not  predictable  between  re‐\npeated invocations of Python.\n\nThis  is  intended  to  provide protection against a denial of service caused by care‐\nfully-chosen inputs that exploit the worst case performance of  a  dict  construction,\nO(n^2)  complexity.   See  http://www.ocert.org/advisories/ocert-2011-003.html for de‐\ntails.\n",
                    "flag": "-R"
                },
                {
                    "name": "-Q",
                    "content": "Division control; see PEP 238.  The argument  must  be  one  of  \"old\"  (the  default,\nint/int  and  long/long  return  an  int or long), \"new\" (new division semantics, i.e.\nint/int and long/long returns a float), \"warn\" (old division semantics with a  warning\nfor  int/int  and  long/long), or \"warnall\" (old division semantics with a warning for\nall use of the division operator).  For a use of \"warnall\", see the Tools/scripts/fix‐\ndiv.py script.\n",
                    "flag": "-Q"
                },
                {
                    "name": "-s",
                    "content": "",
                    "flag": "-s"
                },
                {
                    "name": "-S",
                    "content": "that it entails.\n",
                    "flag": "-S"
                },
                {
                    "name": "-t",
                    "content": "makes  it  depend  on the worth of a tab expressed in spaces.  Issue an error when the\noption is given twice.\n",
                    "flag": "-t"
                },
                {
                    "name": "-u",
                    "content": "also put stdin, stdout and stderr in binary mode.  Note that there is internal buffer‐\ning in xreadlines(), readlines() and file-object iterators (\"for line  in  sys.stdin\")\nwhich  is  not  influenced  by this option.  To work around this, you will want to use\n\"sys.stdin.readline()\" inside a \"while 1:\" loop.\n",
                    "flag": "-u"
                },
                {
                    "name": "-v",
                    "content": "built-in  module) from which it is loaded.  When given twice, print a message for each\nfile that is checked for when searching for a module.  Also  provides  information  on\nmodule cleanup at exit.\n",
                    "flag": "-v"
                },
                {
                    "name": "-V ,  --version",
                    "content": "Prints the Python version number of the executable and exits.\n",
                    "flag": "-V",
                    "long": "--version"
                },
                {
                    "name": "-W",
                    "content": "Warning  control.   Python  sometimes prints warning message to sys.stderr.  A typical\nwarning message has the following form: file:line:  category:  message.   By  default,\neach  warning  is printed once for each source line where it occurs.  This option con‐\ntrols how often warnings are printed.  Multiple -W options may be given; when a  warn‐\ning  matches  more  than  one  option, the action for the last matching option is per‐\nformed.  Invalid -W options are ignored (a warning message is  printed  about  invalid\noptions  when  the  first  warning  is  issued).  Warnings can also be controlled from\nwithin a Python program using the warnings module.\n\nThe simplest form of argument is one of the following action strings (or a unique  ab‐\nbreviation):  ignore to ignore all warnings; default to explicitly request the default\nbehavior (printing each warning once per source line); all to  print  a  warning  each\ntime  it  occurs (this may generate many messages if a warning is triggered repeatedly\nfor the same source line, such as inside a loop); module to print  each  warning  only\nthe  first  time  it  occurs in each module; once to print each warning only the first\ntime it occurs in the program; or error to raise an exception instead  of  printing  a\nwarning message.\n\nThe  full form of argument is action:message:category:module:line.  Here, action is as\nexplained above but only applies to messages that match the remaining  fields.   Empty\nfields  match  all  values;  trailing  empty fields may be omitted.  The message field\nmatches the start of the warning message printed; this match is case-insensitive.  The\ncategory  field  matches  the  warning category.  This must be a class name; the match\ntest whether the actual warning category of the message is a subclass of the specified\nwarning  category.   The  full class name must be given.  The module field matches the\n(fully-qualified) module name; this match is case-sensitive.  The line  field  matches\nthe  line  number,  where  zero  matches all line numbers and is thus equivalent to an\nomitted line number.\n",
                    "flag": "-W"
                },
                {
                    "name": "-x",
                    "content": "Warning: the line numbers in error messages will be off by one!\n",
                    "flag": "-x"
                },
                {
                    "name": "-3",
                    "content": "",
                    "flag": "-3"
                }
            ]
        },
        "INTERPRETER INTERFACE": {
            "content": "The  interpreter  interface resembles that of the UNIX shell: when called with standard input\nconnected to a tty device, it prompts for commands and executes them until an  EOF  is  read;\nwhen called with a file name argument or with a file as standard input, it reads and executes\na script from that file; when called with -c command, it  executes  the  Python  statement(s)\ngiven as command.  Here command may contain multiple statements separated by newlines.  Lead‐\ning whitespace is significant in Python statements!  In non-interactive mode, the entire  in‐\nput is parsed before it is executed.\n\nIf available, the script name and additional arguments thereafter are passed to the script in\nthe Python variable sys.argv, which is a list of strings (you must first  import  sys  to  be\nable  to  access  it).   If no script name is given, sys.argv[0] is an empty string; if -c is\nused, sys.argv[0] contains the string '-c'.  Note that options interpreted by the Python  in‐\nterpreter itself are not placed in sys.argv.\n\nIn  interactive  mode,  the  primary prompt is `>>>'; the second prompt (which appears when a\ncommand is not complete) is `...'.  The prompts can be changed by assignment  to  sys.ps1  or\nsys.ps2.   The  interpreter quits when it reads an EOF at a prompt.  When an unhandled excep‐\ntion occurs, a stack trace is printed and control returns to the primary prompt;  in  non-in‐\nteractive  mode,  the interpreter exits after printing the stack trace.  The interrupt signal\nraises the KeyboardInterrupt exception; other UNIX signals are not caught (except  that  SIG‐\nPIPE is sometimes ignored, in favor of the IOError exception).  Error messages are written to\nstderr.\n",
            "subsections": []
        },
        "FILES AND DIRECTORIES": {
            "content": "These are subject to difference depending on local installation  conventions;  ${prefix}  and\n${execprefix} are installation-dependent and should be interpreted as for GNU software; they\nmay be the same.  On Debian 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 modules.\n\n${prefix}/include/python<version>\n${execprefix}/include/python<version>\nRecommended locations of the directories containing the include files needed  for  de‐\nveloping Python extensions and embedding the interpreter.\n\n~/.pythonrc.py\nUser-specific initialization file loaded by the user module; not used by default or by\nmost applications.\n",
            "subsections": []
        },
        "ENVIRONMENT VARIABLES": {
            "content": "PYTHONHOME\nChange the location of the standard Python libraries.  By default, the  libraries  are\nsearched   in  ${prefix}/lib/python<version>  and  ${execprefix}/lib/python<version>,\nwhere ${prefix} and ${execprefix} are installation-dependent  directories,  both  de‐\nfaulting  to /usr/local.  When $PYTHONHOME is set to a single directory, its value re‐\nplaces both ${prefix} and ${execprefix}.  To specify different values for these,  set\n$PYTHONHOME to ${prefix}:${execprefix}.\n\nPYTHONPATH\nAugments  the  default  search  path  for module files.  The format is the same as the\nshell's $PATH: one or more directory pathnames separated by colons.  Non-existent  di‐\nrectories  are  silently  ignored.  The default search path is installation dependent,\nbut generally begins with ${prefix}/lib/python<version> (see PYTHONHOME  above).   The\ndefault search path is always appended to $PYTHONPATH.  If a script argument is given,\nthe directory containing the script is inserted in the path in front  of  $PYTHONPATH.\nThe  search  path  can  be  manipulated  from  within a Python program as the variable\nsys.path.\n\nPYTHONSTARTUP\nIf this is the name of a readable file, the Python commands in that file are  executed\nbefore the first prompt is displayed in interactive mode.  The file is executed in the\nsame name space where interactive commands are executed so that objects defined or im‐\nported  in  it  can be used without qualification in the interactive session.  You can\nalso change the prompts sys.ps1 and sys.ps2 in this file.\n\nPYTHONY2K\nSet this to a non-empty string to cause the time module to require dates specified  as\nstrings to include 4-digit years, otherwise 2-digit years are converted based on rules\ndescribed in the time module documentation.\n\nPYTHONOPTIMIZE\nIf this is set to a non-empty string it is equivalent to specifying the -O option.  If\nset to an integer, it is equivalent to specifying -O multiple times.\n\nPYTHONDEBUG\nIf  this is set to a non-empty string it is equivalent to specifying the -d option. If\nset to an integer, it is equivalent to specifying -d multiple times.\n\nPYTHONDONTWRITEBYTECODE\nIf this is set to a non-empty string it is equivalent  to  specifying  the  -B  option\n(don't try to write .py[co] files).\n\nPYTHONINSPECT\nIf this is set to a non-empty string it is equivalent to specifying the -i option.\n\nPYTHONIOENCODING\nIf  this  is  set  before  running the interpreter, it overrides the encoding used for\nstdin/stdout/stderr, in the syntax encodingname:errorhandler The errorhandler part  is\noptional and has the same 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 specifying the -s option\n(Don't add the user site directory to sys.path).\n\nPYTHONUNBUFFERED\nIf this is set to a non-empty string it is equivalent to specifying the -u option.\n\nPYTHONVERBOSE\nIf this is set to a non-empty string it is equivalent to specifying the -v option.  If\nset to an integer, it is equivalent to specifying -v multiple times.\n\nPYTHONWARNINGS\nIf  this  is set to a comma-separated string it is equivalent to specifying the -W op‐\ntion for each separate value.\n\nPYTHONHASHSEED\nIf this variable is set to \"random\", the effect is the same as specifying the  -R  op‐\ntion: a random value is used to seed the hashes of str, bytes and datetime objects.\n\nIf  PYTHONHASHSEED is set to an integer value, it is used as a fixed seed for generat‐\ning the hash() of the types covered by the hash randomization.  Its purpose is to  al‐\nlow  repeatable hashing, such as for selftests for the interpreter itself, or to allow\na cluster of python processes to share hash values.\n\nThe integer must be a decimal number in  the  range  [0,4294967295].   Specifying  the\nvalue 0 will lead to the same hash values as when hash randomization is disabled.\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:    file:///usr/share/doc/python2.7/html/index.html   (python-doc  package)  or\nhttps://docs.python.org/2/\nDeveloper resources:  https://docs.python.org/devguide/\nDownloads:  https://www.python.org/downloads/\nModule repository:  https://pypi.python.org/\nNewsgroups:  comp.lang.python, comp.lang.python.announce\n",
            "subsections": []
        },
        "LICENSING": {
            "content": "Python is distributed under an Open Source license.  See the file  \"LICENSE\"  in  the  Python\nsource  distribution  for information on terms & conditions for accessing and otherwise using\nPython and for a DISCLAIMER OF ALL WARRANTIES.\n\n\n\nPYTHON(1)",
            "subsections": []
        }
    },
    "summary": "python - an interpreted, interactive, object-oriented programming language",
    "flags": [],
    "examples": [],
    "see_also": []
}