The sys Module
The sys module contains interpreter-related exports. It also
provides access to some environment components, such as the command
line, standard streams, and so on.
argvCommand-line argument strings list:
[command,arguments...]. Like C’sargvarray.byteorderIndicates the native byte-order (e.g.,
bigfor big-endian).builtin_module_namesTuple of string names of C modules compiled into this Python interpreter.
copyrightString containing the Python interpreter copyright.
dllhandlePython DLL integer handle; Windows only (see the Python Library Reference).
displayhook(value)Called by Python to display result values in interactive sessions; assign
sys.displayhookto a one-argument function to customize output.excepthook(type, value, traceback)Called by Python to display uncaught exception details to
stderr; assignsys.excepthookto a three-argument function to customize exception displays.exc_info()Returns tuple of three values describing the exception currently being handled
(type,value,traceback), wheretypeis the exception class,valueis the instance of the exception class raised, andtracebackis an object that gives access to the runtime call stack as it existed when the exception occurred. Specific to current thread. Subsumesexc_type,exc_value, andexc_tracebackin Python 1.5 and later (all three of which are removed completely in Python 3.0). See thetracebackmodule in the Python Library Reference for processing traceback objects, and The try Statement for more ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access