{
    "mode": "pydoc",
    "parameter": "sys",
    "section": "",
    "url": "https://www.chedong.com/phpMan.php/pydoc/sys/json",
    "generated": "2026-06-02T15:48:29Z",
    "sections": {
        "NAME": {
            "content": "sys\n",
            "subsections": []
        },
        "MODULE REFERENCE": {
            "content": "https://docs.python.org/3.10/library/sys.html\n\nThe following documentation is automatically generated from the Python\nsource files.  It may be incomplete, incorrect or include features that\nare considered implementation detail and may vary between Python\nimplementations.  When in doubt, consult the module reference at the\nlocation listed above.\n",
            "subsections": []
        },
        "DESCRIPTION": {
            "content": "This module provides access to some objects used or maintained by the\ninterpreter and to functions that interact strongly with the interpreter.\n\nDynamic objects:\n\nargv -- command line arguments; argv[0] is the script pathname if known\npath -- module search path; path[0] is the script directory, else ''\nmodules -- dictionary of loaded modules\n\ndisplayhook -- called to show results in an interactive session\nexcepthook -- called to handle any uncaught exception other than SystemExit\nTo customize printing in an interactive session or to install a custom\ntop-level exception handler, assign other functions to replace these.\n\nstdin -- standard input file object; used by input()\nstdout -- standard output file object; used by print()\nstderr -- standard error object; used for error messages\nBy assigning other file objects (or objects that behave like files)\nto these, it is possible to redirect all of the interpreter's I/O.\n\nlasttype -- type of last uncaught exception\nlastvalue -- value of last uncaught exception\nlasttraceback -- traceback of last uncaught exception\nThese three are only available in an interactive session after a\ntraceback has been printed.\n\nStatic objects:\n\nbuiltinmodulenames -- tuple of module names built into this interpreter\ncopyright -- copyright notice pertaining to this interpreter\nexecprefix -- prefix used to find the machine-specific Python library\nexecutable -- absolute path of the executable binary of the Python interpreter\nfloatinfo -- a named tuple with information about the float implementation.\nfloatreprstyle -- string indicating the style of repr() output for floats\nhashinfo -- a named tuple with information about the hash algorithm.\nhexversion -- version information encoded as a single integer\nimplementation -- Python implementation information.\nintinfo -- a named tuple with information about the int implementation.\nmaxsize -- the largest supported length of containers.\nmaxunicode -- the value of the largest Unicode code point\nplatform -- platform identifier\nprefix -- prefix used to find the Python library\nthreadinfo -- a named tuple with information about the thread implementation.\nversion -- the version of this interpreter as a string\nversioninfo -- version information as a named tuple\nstdin -- the original stdin; don't touch!\nstdout -- the original stdout; don't touch!\nstderr -- the original stderr; don't touch!\ndisplayhook -- the original displayhook; don't touch!\nexcepthook -- the original excepthook; don't touch!\n\nFunctions:\n",
            "subsections": [
                {
                    "name": "displayhook",
                    "content": ""
                },
                {
                    "name": "excepthook",
                    "content": ""
                },
                {
                    "name": "exc_info",
                    "content": ""
                },
                {
                    "name": "exit",
                    "content": ""
                },
                {
                    "name": "getdlopenflags",
                    "content": ""
                },
                {
                    "name": "getprofile",
                    "content": ""
                },
                {
                    "name": "getrefcount",
                    "content": ""
                },
                {
                    "name": "getrecursionlimit",
                    "content": ""
                },
                {
                    "name": "getsizeof",
                    "content": ""
                },
                {
                    "name": "gettrace",
                    "content": ""
                },
                {
                    "name": "setdlopenflags",
                    "content": ""
                },
                {
                    "name": "setprofile",
                    "content": ""
                },
                {
                    "name": "setrecursionlimit",
                    "content": ""
                },
                {
                    "name": "settrace",
                    "content": ""
                }
            ]
        },
        "FUNCTIONS": {
            "content": "breakpointhook = breakpointhook(...)\nbreakpointhook(*args, kws)\n\nThis hook function is called by built-in breakpoint().\n\ndisplayhook = displayhook(object, /)\nPrint an object to sys.stdout and also save it in builtins.\n\nexcepthook = excepthook(exctype, value, traceback, /)\nHandle an exception by displaying it with a traceback on sys.stderr.\n\nunraisablehook = unraisablehook(unraisable, /)\nHandle an unraisable exception.\n\nThe unraisable argument has the following attributes:\n\n* exctype: Exception type.\n* excvalue: Exception value, can be None.\n* exctraceback: Exception traceback, can be None.\n* errmsg: Error message, can be None.\n* object: Object causing the exception, can be None.\n",
            "subsections": [
                {
                    "name": "addaudithook",
                    "content": "Adds a new audit hook callback.\n"
                },
                {
                    "name": "audit",
                    "content": "audit(event, *args)\n\nPasses the event to any audit hooks that are attached.\n"
                },
                {
                    "name": "breakpointhook",
                    "content": "breakpointhook(*args, kws)\n\nThis hook function is called by built-in breakpoint().\n"
                },
                {
                    "name": "call_tracing",
                    "content": "Call func(*args), while tracing is enabled.\n\nThe tracing state is saved, and restored afterwards.  This is intended\nto be called from a debugger from a checkpoint, to recursively debug\nsome other code.\n"
                },
                {
                    "name": "displayhook",
                    "content": "Print an object to sys.stdout and also save it in builtins.\n"
                },
                {
                    "name": "exc_info",
                    "content": "Return current exception information: (type, value, traceback).\n\nReturn information about the most recent exception caught by an except\nclause in the current stack frame or in an older stack frame.\n"
                },
                {
                    "name": "exit",
                    "content": "Exit the interpreter by raising SystemExit(status).\n\nIf the status is omitted or None, it defaults to zero (i.e., success).\nIf the status is an integer, it will be used as the system exit status.\nIf it is another kind of object, it will be printed and the system\nexit status will be one (i.e., failure).\n"
                },
                {
                    "name": "get_asyncgen_hooks",
                    "content": "Return the installed asynchronous generators hooks.\n\nThis returns a namedtuple of the form (firstiter, finalizer).\n"
                },
                {
                    "name": "get_coroutine_origin_tracking_depth",
                    "content": "Check status of origin tracking for coroutine objects in this thread.\n"
                },
                {
                    "name": "get_int_max_str_digits",
                    "content": "Return the maximum string digits limit for non-binary int<->str conversions.\n"
                },
                {
                    "name": "getallocatedblocks",
                    "content": "Return the number of memory blocks currently allocated.\n"
                },
                {
                    "name": "getdefaultencoding",
                    "content": "Return the current default encoding used by the Unicode implementation.\n"
                },
                {
                    "name": "getdlopenflags",
                    "content": "Return the current value of the flags that are used for dlopen calls.\n\nThe flag constants are defined in the os module.\n"
                },
                {
                    "name": "getfilesystemencodeerrors",
                    "content": "Return the error mode used Unicode to OS filename conversion.\n"
                },
                {
                    "name": "getfilesystemencoding",
                    "content": "Return the encoding used to convert Unicode filenames to OS filenames.\n"
                },
                {
                    "name": "getprofile",
                    "content": "Return the profiling function set with sys.setprofile.\n\nSee the profiler chapter in the library manual.\n"
                },
                {
                    "name": "getrecursionlimit",
                    "content": "Return the current value of the recursion limit.\n\nThe recursion limit is the maximum depth of the Python interpreter\nstack.  This limit prevents infinite recursion from causing an overflow\nof the C stack and crashing Python.\n"
                },
                {
                    "name": "getrefcount",
                    "content": "Return the reference count of object.\n\nThe count returned is generally one higher than you might expect,\nbecause it includes the (temporary) reference as an argument to\ngetrefcount().\n"
                },
                {
                    "name": "getsizeof",
                    "content": "getsizeof(object [, default]) -> int\n\nReturn the size of object in bytes.\n"
                },
                {
                    "name": "getswitchinterval",
                    "content": "Return the current thread switch interval; see sys.setswitchinterval().\n"
                },
                {
                    "name": "gettrace",
                    "content": "Return the global debug tracing function set with sys.settrace.\n\nSee the debugger chapter in the library manual.\n"
                },
                {
                    "name": "intern",
                    "content": "``Intern'' the given string.\n\nThis enters the string in the (global) table of interned strings whose\npurpose is to speed up dictionary lookups. Return the string itself or\nthe previously interned string object with the same value.\n"
                },
                {
                    "name": "is_finalizing",
                    "content": "Return True if Python is exiting.\n"
                },
                {
                    "name": "set_asyncgen_hooks",
                    "content": "setasyncgenhooks(* [, firstiter] [, finalizer])\n\nSet a finalizer for async generators objects.\n"
                },
                {
                    "name": "set_coroutine_origin_tracking_depth",
                    "content": "Enable or disable origin tracking for coroutine objects in this thread.\n\nCoroutine objects will track 'depth' frames of traceback information\nabout where they came from, available in their crorigin attribute.\n\nSet a depth of 0 to disable.\n"
                },
                {
                    "name": "set_int_max_str_digits",
                    "content": "Set the maximum string digits limit for non-binary int<->str conversions.\n"
                },
                {
                    "name": "setdlopenflags",
                    "content": "Set the flags used by the interpreter for dlopen calls.\n\nThis is used, for example, when the interpreter loads extension\nmodules. Among other things, this will enable a lazy resolving of\nsymbols when importing a module, if called as sys.setdlopenflags(0).\nTo share symbols across extension modules, call as\nsys.setdlopenflags(os.RTLDGLOBAL).  Symbolic names for the flag\nmodules can be found in the os module (RTLDxxx constants, e.g.\nos.RTLDLAZY).\n"
                },
                {
                    "name": "setprofile",
                    "content": "setprofile(function)\n\nSet the profiling function.  It will be called on each function call\nand return.  See the profiler chapter in the library manual.\n"
                },
                {
                    "name": "setrecursionlimit",
                    "content": "Set the maximum depth of the Python interpreter stack to n.\n\nThis limit prevents infinite recursion from causing an overflow of the C\nstack and crashing Python.  The highest possible limit is platform-\ndependent.\n"
                },
                {
                    "name": "setswitchinterval",
                    "content": "Set the ideal thread switching delay inside the Python interpreter.\n\nThe actual frequency of switching threads can be lower if the\ninterpreter executes long sequences of uninterruptible code\n(this is implementation-specific and workload-dependent).\n\nThe parameter must represent the desired switching delay in seconds\nA typical value is 0.005 (5 milliseconds).\n"
                },
                {
                    "name": "settrace",
                    "content": "settrace(function)\n\nSet the global debug tracing function.  It will be called on each\nfunction call.  See the debugger chapter in the library manual.\n"
                },
                {
                    "name": "unraisablehook",
                    "content": "Handle an unraisable exception.\n\nThe unraisable argument has the following attributes:\n\n* exctype: Exception type.\n* excvalue: Exception value, can be None.\n* exctraceback: Exception traceback, can be None.\n* errmsg: Error message, can be None.\n* object: Object causing the exception, can be None.\n"
                }
            ]
        },
        "DATA": {
            "content": "stderr = <io.TextIOWrapper name='<stderr>' mode='w' encoding='utf...\nstdin = <io.TextIOWrapper name='<stdin>' mode='r' encoding='utf-8...\nstdout = <io.TextIOWrapper name='<stdout>' mode='w' encoding='utf...\nabiflags = ''\napiversion = 1013\nargv = ['/usr/bin/pydoc3', 'sys']\nbaseexecprefix = '/usr'\nbaseprefix = '/usr'\nbuiltinmodulenames = ('abc', 'ast', 'bisect', 'blake2', 'codecs...\nbyteorder = 'little'\ncopyright = 'Copyright (c) 2001-2023 Python Software Foundati...ematis...\ndontwritebytecode = False\nexecprefix = '/usr'\nexecutable = '/usr/bin/python3.10'\nflags = sys.flags(debug=0, inspect=0, interactive=0, opt..., warndefa...\nfloatinfo = sys.floatinfo(max=1.7976931348623157e+308, max...epsilo...\nfloatreprstyle = 'short'\nhashinfo = sys.hashinfo(width=64, modulus=2305843009213693...iphash2...\nhexversion = 50990320\nimplementation = namespace(name='cpython', cachetag='cpython-310...xv...\nintinfo = sys.intinfo(bitsperdigit=30, sizeofdigit=4, ...strdig...\nmaxsize = 9223372036854775807\nmaxunicode = 1114111\nmetapath = [<class 'frozenimportlib.BuiltinImporter'>, <class 'fro...\nmodules = {'main': <module 'main' from '/usr/bin/pydoc3'>, 'a...\norigargv = ['/usr/bin/python3.10', '/usr/bin/pydoc3', 'sys']\npath = ['/home/chedong/chedong.com', '/usr/lib/python310.zip', '/usr/l...\npathhooks = [<class 'zipimport.zipimporter'>, <function FileFinder.pa...\npathimportercache = {'/home/chedong/.local/lib/python3.10/site-packa...\nplatform = 'linux'\nplatlibdir = 'lib'\nprefix = '/usr'\npycacheprefix = None\nstderr = <io.TextIOWrapper name='<stderr>' mode='w' encoding='utf-8'>\nstdin = <io.TextIOWrapper name='<stdin>' mode='r' encoding='utf-8'>\nstdlibmodulenames = frozenset({'future', 'abc', 'aixsupport',...\nstdout = <io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>\nthreadinfo = sys.threadinfo(name='pthread', lock='semaphore', versio...\nversion = '3.10.12 (main, Mar  3 2026, 11:56:32) [GCC 11.4.0]'\nversioninfo = sys.versioninfo(major=3, minor=10, micro=12, releasele...\nwarnoptions = []\n",
            "subsections": []
        },
        "FILE": {
            "content": "(built-in)\n\n",
            "subsections": []
        }
    },
    "summary": "sys",
    "flags": [],
    "examples": [],
    "see_also": []
}