The sys Module
The attributes of the sys
module are bound to data and functions that provide information on the state of the Python interpreter or affect the interpreter directly. This section documents the most frequently used attributes of sys
, in alphabetical order.
argv | The list of command-line arguments passed to the main script. |
displayhook |
In interactive sessions, the Python interpreter calls if value is not None: _ _builtin_ _._ = value print repr(value) You can rebind |
excepthook |
When an exception is not caught by any handler, and thus propagates all the way up the call stack, Python calls |
exc_info |
If the current thread ... |
Get Python in a Nutshell, 2nd Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.