| 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 as a string
version_info -- version information as a tuple
hexversion -- version information encoded as a single integer
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 | ||
| ||
| Data | ||
| __name__ = 'sys' __stderr__ = <open file '<stderr>', mode 'w' at 8187960> __stdin__ = <open file '<stdin>', mode 'r' at 8187880> __stdout__ = <open file '<stdout>', mode 'w' at 81878f0> argv = ['/usr/bin/pydoc', '-w', '__builtin__', '__main__', '_codecs', '_locale', '_sre', 'array', 'binascii', 'cPickle', 'cStringIO', 'cmath', 'errno', 'fcntl', 'grp', 'imp', 'marshal', 'math', 'md5', 'mmap', ...] builtin_module_names = ('__builtin__', '__main__', '_codecs', '_locale', '_sre', 'array', 'binascii', 'cPickle', 'cStringIO', 'cmath', 'errno', 'fcntl', 'grp', 'imp', 'marshal', 'math', 'md5', 'mmap', 'new', 'operator', ...) copyright = 'Copyright (c) 1995-2000 Corporation for National...ematisch Centrum, Amsterdam.\012All Rights Reserved.' exc_value = <exceptions.TypeError instance at 82a46b8> exec_prefix = '/usr' executable = '/usr/bin/python1.6' hexversion = 17170672 maxint = 2147483647 modules = {'UserDict': <module 'UserDict' from '/usr/lib/python1.6/UserDict.pyc'>, '__builtin__': <module '__builtin__' (built-in)>, '__main__': <module '__main__' (built-in)>, '_codecs': <module '_codecs' (built-in)>, '_locale': <module '_locale' (built-in)>, '_sre': <module '_sre' (built-in)>, 'array': <module 'array' (built-in)>, 'binascii': <module 'binascii' (built-in)>, 'cPickle': <module 'cPickle' (built-in)>, 'cStringIO': <module 'cStringIO' (built-in)>, ...} path = ['.', '', '/usr/lib/python1.6/', '/usr/lib/python1.6/plat-linux2', '/usr/lib/python1.6/lib-tk', '/usr/lib/python1.6/lib-dynload', '/usr/lib/python1.6/site-packages'] platform = 'linux2' prefix = '/usr' stderr = <open file '<stderr>', mode 'w' at 8187960> stdin = <open file '<stdin>', mode 'r' at 8187880> stdout = <open file '<stdout>', mode 'w' at 81878f0> version = '1.6 (#1, Jan 3 2002, 10:47:46) [GCC 2.96 20000731 (Red Hat Linux 7.1 2.96-85)]' version_info = (1, 6, 0, 'final', 0) | ||