| sys | index (built-in) |
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 | |||
| |||
| Constants | |||
argv = ['pydoc.py', '-w', 'sys'] builtin_module_names = ('__builtin__', '__main__', 'imp', 'marshal', 'pcre', 'posix', 'regex', 'signal', 'sys', 'thread') copyright = 'Copyright 1991-1995 Sti...tisch Centrum, Amsterdam' exec_prefix = '/usr' executable = '/usr/bin/python1.5' hexversion = 17105648 maxint = 2147483647 path = ['', '/usr/lib/python1.5/', '/usr/lib/python1.5/plat-linux-i386', '/usr/lib/python1.5/lib-tk', '/usr/lib/python1.5/lib-dynload', '/usr/lib/python1.5/site-packages'] platform = 'linux-i386' prefix = '/usr' version = '1.5.2 (#1, Sep 17 1999,...66 19990314/Linux (egcs-' | |||