1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: built-in module sys</title>
<meta charset="utf-8">
</head><body bgcolor="#f0f0f8">
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong>sys</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br>(built-in)<br><a href="http://docs.python.org/library/sys">Module Docs</a></font></td></tr></table>
<p><tt>This module provides access to some objects used or maintained by the<br>
interpreter and to functions that interact strongly with the interpreter.<br>
<br>
Dynamic objects:<br>
<br>
argv -- command line arguments; argv[0] is the script pathname if known<br>
path -- module search path; path[0] is the script directory, else ''<br>
modules -- dictionary of loaded modules<br>
<br>
displayhook -- called to show results in an interactive session<br>
excepthook -- called to handle any uncaught exception other than SystemExit<br>
To customize printing in an interactive session or to install a custom<br>
top-level exception handler, assign other functions to replace these.<br>
<br>
exitfunc -- if sys.exitfunc exists, this routine is called when Python exits<br>
Assigning to sys.exitfunc is deprecated; use the atexit module instead.<br>
<br>
stdin -- standard input file object; used by raw_input() and input()<br>
stdout -- standard output file object; used by the print statement<br>
stderr -- standard error object; used for error messages<br>
By assigning other file objects (or objects that behave like files)<br>
to these, it is possible to redirect all of the interpreter's I/O.<br>
<br>
last_type -- type of last uncaught exception<br>
last_value -- value of last uncaught exception<br>
last_traceback -- traceback of last uncaught exception<br>
These three are only available in an interactive session after a<br>
traceback has been printed.<br>
<br>
exc_type -- type of exception currently being handled<br>
exc_value -- value of exception currently being handled<br>
exc_traceback -- traceback of exception currently being handled<br>
The function <a href="#-exc_info">exc_info</a>() should be used instead of these three,<br>
because it is thread-safe.<br>
<br>
Static objects:<br>
<br>
float_info -- a dict with information about the float inplementation.<br>
long_info -- a struct sequence with information about the long implementation.<br>
maxint -- the largest supported integer (the smallest is -maxint-1)<br>
maxsize -- the largest supported length of containers.<br>
maxunicode -- the largest supported character<br>
builtin_module_names -- tuple of module names built into this interpreter<br>
version -- the version of this interpreter as a string<br>
version_info -- version information as a named tuple<br>
hexversion -- version information encoded as a single integer<br>
copyright -- copyright notice pertaining to this interpreter<br>
platform -- platform identifier<br>
executable -- absolute path of the executable binary of the Python interpreter<br>
prefix -- prefix used to find the Python library<br>
exec_prefix -- prefix used to find the machine-specific Python library<br>
float_repr_style -- string indicating the style of repr() output for floats<br>
__stdin__ -- the original stdin; don't touch!<br>
__stdout__ -- the original stdout; don't touch!<br>
__stderr__ -- the original stderr; don't touch!<br>
__displayhook__ -- the original displayhook; don't touch!<br>
__excepthook__ -- the original excepthook; don't touch!<br>
<br>
Functions:<br>
<br>
<a href="#-displayhook">displayhook</a>() -- print an object to the screen, and save it in __builtin__._<br>
<a href="#-excepthook">excepthook</a>() -- print an exception and its traceback to sys.stderr<br>
<a href="#-exc_info">exc_info</a>() -- return thread-safe information about the current exception<br>
<a href="#-exc_clear">exc_clear</a>() -- clear the exception state for the current thread<br>
<a href="#-exit">exit</a>() -- exit the interpreter by raising SystemExit<br>
<a href="#-getdlopenflags">getdlopenflags</a>() -- returns flags to be used for dlopen() calls<br>
<a href="#-getprofile">getprofile</a>() -- get the global profiling function<br>
<a href="#-getrefcount">getrefcount</a>() -- return the reference count for an object (plus one :-)<br>
<a href="#-getrecursionlimit">getrecursionlimit</a>() -- return the max recursion depth for the interpreter<br>
<a href="#-getsizeof">getsizeof</a>() -- return the size of an object in bytes<br>
<a href="#-gettrace">gettrace</a>() -- get the global debug tracing function<br>
<a href="#-setcheckinterval">setcheckinterval</a>() -- control how often the interpreter checks for events<br>
<a href="#-setdlopenflags">setdlopenflags</a>() -- set the flags to be used for dlopen() calls<br>
<a href="#-setprofile">setprofile</a>() -- set the global profiling function<br>
<a href="#-setrecursionlimit">setrecursionlimit</a>() -- set the max recursion depth for the interpreter<br>
<a href="#-settrace">settrace</a>() -- set the global debug tracing function</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#eeaa77">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Functions</strong></big></font></td></tr>
<tr><td bgcolor="#eeaa77"><tt> </tt></td><td> </td>
<td width="100%"><dl><dt><a name="-__displayhook__"><strong>__displayhook__</strong></a> = displayhook(...)</dt><dd><tt><a href="#-displayhook">displayhook</a>(object) -> None<br>
<br>
Print an object to sys.stdout and also save it in __builtin__._</tt></dd></dl>
<dl><dt><a name="-__excepthook__"><strong>__excepthook__</strong></a> = excepthook(...)</dt><dd><tt><a href="#-excepthook">excepthook</a>(exctype, value, traceback) -> None<br>
<br>
Handle an exception by displaying it with a traceback on sys.stderr.</tt></dd></dl>
<dl><dt><a name="-call_tracing"><strong>call_tracing</strong></a>(...)</dt><dd><tt><a href="#-call_tracing">call_tracing</a>(func, args) -> object<br>
<br>
Call func(*args), while tracing is enabled. The tracing state is<br>
saved, and restored afterwards. This is intended to be called from<br>
a debugger from a checkpoint, to recursively debug some other code.</tt></dd></dl>
<dl><dt><a name="-callstats"><strong>callstats</strong></a>(...)</dt><dd><tt><a href="#-callstats">callstats</a>() -> tuple of integers<br>
<br>
Return a tuple of function call statistics, if CALL_PROFILE was defined<br>
when Python was built. Otherwise, return None.<br>
<br>
When enabled, this function returns detailed, implementation-specific<br>
details about the number of function calls executed. The return value is<br>
a 11-tuple where the entries in the tuple are counts of:<br>
0. all function calls<br>
1. calls to PyFunction_Type objects<br>
2. PyFunction calls that do not create an argument tuple<br>
3. PyFunction calls that do not create an argument tuple<br>
and bypass PyEval_EvalCodeEx()<br>
4. PyMethod calls<br>
5. PyMethod calls on bound methods<br>
6. PyType calls<br>
7. PyCFunction calls<br>
8. generator calls<br>
9. All other calls<br>
10. Number of stack pops performed by call_function()</tt></dd></dl>
<dl><dt><a name="-displayhook"><strong>displayhook</strong></a>(...)</dt><dd><tt><a href="#-displayhook">displayhook</a>(object) -> None<br>
<br>
Print an object to sys.stdout and also save it in __builtin__._</tt></dd></dl>
<dl><dt><a name="-exc_clear"><strong>exc_clear</strong></a>(...)</dt><dd><tt><a href="#-exc_clear">exc_clear</a>() -> None<br>
<br>
Clear global information on the current exception. Subsequent calls to<br>
<a href="#-exc_info">exc_info</a>() will return (None,None,None) until another exception is raised<br>
in the current thread or the execution stack returns to a frame where<br>
another exception is being handled.</tt></dd></dl>
<dl><dt><a name="-exc_info"><strong>exc_info</strong></a>(...)</dt><dd><tt><a href="#-exc_info">exc_info</a>() -> (type, value, traceback)<br>
<br>
Return information about the most recent exception caught by an except<br>
clause in the current stack frame or in an older stack frame.</tt></dd></dl>
<dl><dt><a name="-excepthook"><strong>excepthook</strong></a>(...)</dt><dd><tt><a href="#-excepthook">excepthook</a>(exctype, value, traceback) -> None<br>
<br>
Handle an exception by displaying it with a traceback on sys.stderr.</tt></dd></dl>
<dl><dt><a name="-exit"><strong>exit</strong></a>(...)</dt><dd><tt><a href="#-exit">exit</a>([status])<br>
<br>
Exit the interpreter by raising SystemExit(status).<br>
If the status is omitted or None, it defaults to zero (i.e., success).<br>
If the status is an integer, it will be used as the system exit status.<br>
If it is another kind of object, it will be printed and the system<br>
exit status will be one (i.e., failure).</tt></dd></dl>
<dl><dt><a name="-getcheckinterval"><strong>getcheckinterval</strong></a>(...)</dt><dd><tt><a href="#-getcheckinterval">getcheckinterval</a>() -> current check interval; see <a href="#-setcheckinterval">setcheckinterval</a>().</tt></dd></dl>
<dl><dt><a name="-getdefaultencoding"><strong>getdefaultencoding</strong></a>(...)</dt><dd><tt><a href="#-getdefaultencoding">getdefaultencoding</a>() -> string<br>
<br>
Return the current default string encoding used by the Unicode <br>
implementation.</tt></dd></dl>
<dl><dt><a name="-getdlopenflags"><strong>getdlopenflags</strong></a>(...)</dt><dd><tt><a href="#-getdlopenflags">getdlopenflags</a>() -> int<br>
<br>
Return the current value of the flags that are used for dlopen calls.<br>
The flag constants are defined in the ctypes and DLFCN modules.</tt></dd></dl>
<dl><dt><a name="-getfilesystemencoding"><strong>getfilesystemencoding</strong></a>(...)</dt><dd><tt><a href="#-getfilesystemencoding">getfilesystemencoding</a>() -> string<br>
<br>
Return the encoding used to convert Unicode filenames in<br>
operating system filenames.</tt></dd></dl>
<dl><dt><a name="-getprofile"><strong>getprofile</strong></a>(...)</dt><dd><tt><a href="#-getprofile">getprofile</a>()<br>
<br>
Return the profiling function set with sys.setprofile.<br>
See the profiler chapter in the library manual.</tt></dd></dl>
<dl><dt><a name="-getrecursionlimit"><strong>getrecursionlimit</strong></a>(...)</dt><dd><tt><a href="#-getrecursionlimit">getrecursionlimit</a>()<br>
<br>
Return the current value of the recursion limit, the maximum depth<br>
of the Python interpreter stack. This limit prevents infinite<br>
recursion from causing an overflow of the C stack and crashing Python.</tt></dd></dl>
<dl><dt><a name="-getrefcount"><strong>getrefcount</strong></a>(...)</dt><dd><tt><a href="#-getrefcount">getrefcount</a>(object) -> integer<br>
<br>
Return the reference count of object. The count returned is generally<br>
one higher than you might expect, because it includes the (temporary)<br>
reference as an argument to <a href="#-getrefcount">getrefcount</a>().</tt></dd></dl>
<dl><dt><a name="-getsizeof"><strong>getsizeof</strong></a>(...)</dt><dd><tt><a href="#-getsizeof">getsizeof</a>(object, default) -> int<br>
<br>
Return the size of object in bytes.</tt></dd></dl>
<dl><dt><a name="-gettrace"><strong>gettrace</strong></a>(...)</dt><dd><tt><a href="#-gettrace">gettrace</a>()<br>
<br>
Return the global debug tracing function set with sys.settrace.<br>
See the debugger chapter in the library manual.</tt></dd></dl>
<dl><dt><a name="-setcheckinterval"><strong>setcheckinterval</strong></a>(...)</dt><dd><tt><a href="#-setcheckinterval">setcheckinterval</a>(n)<br>
<br>
Tell the Python interpreter to check for asynchronous events every<br>
n instructions. This also affects how often thread switches occur.</tt></dd></dl>
<dl><dt><a name="-setdlopenflags"><strong>setdlopenflags</strong></a>(...)</dt><dd><tt><a href="#-setdlopenflags">setdlopenflags</a>(n) -> None<br>
<br>
Set the flags used by the interpreter for dlopen calls, such as when the<br>
interpreter loads extension modules. Among other things, this will enable<br>
a lazy resolving of symbols when importing a module, if called as<br>
sys.<a href="#-setdlopenflags">setdlopenflags</a>(0). To share symbols across extension modules, call as<br>
sys.<a href="#-setdlopenflags">setdlopenflags</a>(ctypes.RTLD_GLOBAL). Symbolic names for the flag modules<br>
can be either found in the ctypes module, or in the DLFCN module. If DLFCN<br>
is not available, it can be generated from /usr/include/dlfcn.h using the<br>
h2py script.</tt></dd></dl>
<dl><dt><a name="-setprofile"><strong>setprofile</strong></a>(...)</dt><dd><tt><a href="#-setprofile">setprofile</a>(function)<br>
<br>
Set the profiling function. It will be called on each function call<br>
and return. See the profiler chapter in the library manual.</tt></dd></dl>
<dl><dt><a name="-setrecursionlimit"><strong>setrecursionlimit</strong></a>(...)</dt><dd><tt><a href="#-setrecursionlimit">setrecursionlimit</a>(n)<br>
<br>
Set the maximum depth of the Python interpreter stack to n. This<br>
limit prevents infinite recursion from causing an overflow of the C<br>
stack and crashing Python. The highest possible limit is platform-<br>
dependent.</tt></dd></dl>
<dl><dt><a name="-settrace"><strong>settrace</strong></a>(...)</dt><dd><tt><a href="#-settrace">settrace</a>(function)<br>
<br>
Set the global debug tracing function. It will be called on each<br>
function call. See the debugger chapter in the library manual.</tt></dd></dl>
</td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#55aa55">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
<tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td>
<td width="100%"><strong>__stderr__</strong> = <open file '<stderr>', mode 'w'><br>
<strong>__stdin__</strong> = <open file '<stdin>', mode 'r'><br>
<strong>__stdout__</strong> = <open file '<stdout>', mode 'w'><br>
<strong>api_version</strong> = 1013<br>
<strong>argv</strong> = ['/usr/local/bin/pydoc', '-w', 'sys']<br>
<strong>builtin_module_names</strong> = ('__builtin__', '__main__', '_ast', '_codecs', '_sre', '_symtable', '_warnings', '_weakref', 'errno', 'exceptions', 'gc', 'imp', 'marshal', 'posix', 'pwd', 'signal', 'sys', 'thread', 'xxsubtype', 'zipimport')<br>
<strong>byteorder</strong> = 'little'<br>
<strong>copyright</strong> = 'Copyright (c) 2001-2015 Python Software Foundati...ematisch Centrum, Amsterdam.<font color="#c040c0">\n</font>All Rights Reserved.'<br>
<strong>dont_write_bytecode</strong> = False<br>
<strong>exc_value</strong> = TypeError("<module 'sys' (built-in)> is a built-in module",)<br>
<strong>exec_prefix</strong> = '/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7'<br>
<strong>executable</strong> = '/usr/local/opt/python/bin/python2.7'<br>
<strong>flags</strong> = sys.flags(debug=0, py3k_warning=0, division_warn...unicode=0, bytes_warning=0, hash_randomization=0)<br>
<strong>float_info</strong> = sys.float_info(max=1.7976931348623157e+308, max_...epsilon=2.220446049250313e-16, radix=2, rounds=1)<br>
<strong>float_repr_style</strong> = 'short'<br>
<strong>hexversion</strong> = 34015984<br>
<strong>long_info</strong> = sys.long_info(bits_per_digit=30, sizeof_digit=4)<br>
<strong>maxint</strong> = 9223372036854775807<br>
<strong>maxsize</strong> = 9223372036854775807<br>
<strong>maxunicode</strong> = 65535<br>
<strong>meta_path</strong> = []<br>
<strong>modules</strong> = {'UserDict': <module 'UserDict' from '/usr/local/Cellar/pytho...amework/Versions/2.7/lib/python2.7/UserDict.pyc'>, '__builtin__': <module '__builtin__' (built-in)>, '__main__': <module '__main__' from '/usr/local/bin/pydoc'>, '_abcoll': <module '_abcoll' from '/usr/local/Cellar/python...ramework/Versions/2.7/lib/python2.7/_abcoll.pyc'>, '_codecs': <module '_codecs' (built-in)>, '_collections': <module '_collections' from '/usr/local/Cellar/p...s/2.7/lib/python2.7/lib-dynload/_collections.so'>, '_functools': <module '_functools' from '/usr/local/Cellar/pyt...ons/2.7/lib/python2.7/lib-dynload/_functools.so'>, '_heapq': <module '_heapq' from '/usr/local/Cellar/python/...ersions/2.7/lib/python2.7/lib-dynload/_heapq.so'>, '_locale': <module '_locale' from '/usr/local/Cellar/python...rsions/2.7/lib/python2.7/lib-dynload/_locale.so'>, '_osx_support': <module '_osx_support' from '/usr/local/Cellar/p...ork/Versions/2.7/lib/python2.7/_osx_support.pyc'>, ...}<br>
<strong>path</strong> = ['.', '/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/bin', '/Users/d3y382/workspaces/apbs-pdb2pqr/pdb2pqr/doc/pydoc', '/Users/d3y382/workspaces/apbs-pdb2pqr/pdb2pqr', '/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python27.zip', '/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7', '/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', '/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', '/usr/local/Cellar/python/2.7.10_2/Frameworks/Pyt...ons/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', '/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old', '/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload', '/usr/local/lib/python2.7/site-packages']<br>
<strong>path_hooks</strong> = [<type 'zipimport.zipimporter'>]<br>
<strong>path_importer_cache</strong> = {'': None, '/Users/d3y382/workspaces/apbs-pdb2pqr/pdb2pqr': None, '/Users/d3y382/workspaces/apbs-pdb2pqr/pdb2pqr/doc/pydoc': None, '/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/bin': None, '/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7': None, '/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/': None, '/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/encodings': None, '/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload': None, '/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old': <imp.NullImporter object>, '/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk': None, ...}<br>
<strong>platform</strong> = 'darwin'<br>
<strong>prefix</strong> = '/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7'<br>
<strong>py3kwarning</strong> = False<br>
<strong>stderr</strong> = <open file '<stderr>', mode 'w'><br>
<strong>stdin</strong> = <open file '<stdin>', mode 'r'><br>
<strong>stdout</strong> = <open file '<stdout>', mode 'w'><br>
<strong>subversion</strong> = ('CPython', '', '')<br>
<strong>version</strong> = '2.7.10 (default, Oct 29 2015, 17:29:36) <font color="#c040c0">\n</font>[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)]'<br>
<strong>version_info</strong> = sys.version_info(major=2, minor=7, micro=10, releaselevel='final', serial=0)<br>
<strong>warnoptions</strong> = []</td></tr></table>
</body></html>
|