sys |
This module provides access to some objects used or maintained by the
interpreter and to functions that interact strongly with the interpreter.
Dynamic objects:
argv -- command line arguments; argv[0] is the script pathname if known
path -- module search path; path[0] is the script directory, else ''
modules -- dictionary of loaded modules
exitfunc -- you may set this to a function to be called when Python exits
stdin -- standard input file object; used by raw_input() and input()
stdout -- standard output file object; used by the print statement
stderr -- standard error object; used for error messages
By assigning another file object (or an object that behaves like a file)
to one of these, it is possible to redirect all of the interpreter's I/O.
last_type -- type of last uncaught exception
last_value -- value of last uncaught exception
last_traceback -- traceback of last uncaught exception
These three are only available in an interactive session after a
traceback has been printed.
exc_type -- type of exception currently being handled
exc_value -- value of exception currently being handled
exc_traceback -- traceback of exception currently being handled
The function exc_info() should be used instead of these three,
because it is thread-safe.
Static objects:
maxint -- the largest supported integer (the smallest is -maxint-1)
builtin_module_names -- tuple of module names built into this intepreter
version -- the version of this interpreter
copyright -- copyright notice pertaining to this interpreter
platform -- platform identifier
executable -- pathname of this Python interpreter
prefix -- prefix used to find the Python library
exec_prefix -- prefix used to find the machine-specific Python library
dllhandle -- [Windows only] integer handle of the Python DLL
winver -- [Windows only] version number of the Python DLL
__stdin__ -- the original stdin; don't use!
__stdout__ -- the original stdout; don't use!
__stderr__ -- the original stderr; don't use!
Functions:
exc_info() -- return thread-safe information about the current exception
exit() -- exit the interpreter by raising SystemExit
getrefcount() -- return the reference count for an object (plus one :-)
setcheckinterval() -- control how often the interpreter checks for events
setprofile() -- set the global profiling function
settrace() -- set the global debug tracing function
Functions | ||
|