1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
<html xmlns="http://www.w3.org/1999/xhtml">
7
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
9
<title>29. Python Runtime Services — Python 3.5.1 documentation</title>
11
<link rel="stylesheet" href="../_static/pydoctheme.css" type="text/css" />
12
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
14
<script type="text/javascript">
15
var DOCUMENTATION_OPTIONS = {
18
COLLAPSE_INDEX: false,
23
<script type="text/javascript" src="../_static/jquery.js"></script>
24
<script type="text/javascript" src="../_static/underscore.js"></script>
25
<script type="text/javascript" src="../_static/doctools.js"></script>
26
<script type="text/javascript" src="../_static/sidebar.js"></script>
27
<link rel="search" type="application/opensearchdescription+xml"
28
title="Search within Python 3.5.1 documentation"
29
href="../_static/opensearch.xml"/>
30
<link rel="author" title="About these documents" href="../about.html" />
31
<link rel="copyright" title="Copyright" href="../copyright.html" />
32
<link rel="top" title="Python 3.5.1 documentation" href="../contents.html" />
33
<link rel="up" title="The Python Standard Library" href="index.html" />
34
<link rel="next" title="29.1. sys — System-specific parameters and functions" href="sys.html" />
35
<link rel="prev" title="28.4. zipapp — Manage executable python zip archives" href="zipapp.html" />
36
<link rel="shortcut icon" type="image/png" href="../_static/py.png" />
37
<script type="text/javascript" src="../_static/copybutton.js"></script>
38
<script type="text/javascript" src="../_static/version_switch.js"></script>
43
<body role="document">
44
<div class="related" role="navigation" aria-label="related navigation">
47
<li class="right" style="margin-right: 10px">
48
<a href="../genindex.html" title="General Index"
49
accesskey="I">index</a></li>
51
<a href="../py-modindex.html" title="Python Module Index"
54
<a href="sys.html" title="29.1. sys — System-specific parameters and functions"
55
accesskey="N">next</a> |</li>
57
<a href="zipapp.html" title="28.4. zipapp — Manage executable python zip archives"
58
accesskey="P">previous</a> |</li>
59
<li><img src="../_static/py.png" alt=""
60
style="vertical-align: middle; margin-top: -1px"/></li>
61
<li><a href="https://www.python.org/">Python</a> »</li>
63
<span class="version_switcher_placeholder">3.5.1</span>
64
<a href="../index.html">Documentation </a> »
67
<li class="nav-item nav-item-1"><a href="index.html" accesskey="U">The Python Standard Library</a> »</li>
71
<div class="document">
72
<div class="documentwrapper">
73
<div class="bodywrapper">
74
<div class="body" role="main">
76
<div class="section" id="python-runtime-services">
77
<span id="python"></span><h1>29. Python Runtime Services<a class="headerlink" href="#python-runtime-services" title="Permalink to this headline">¶</a></h1>
78
<p>The modules described in this chapter provide a wide range of services related
79
to the Python interpreter and its interaction with its environment. Here’s an
81
<div class="toctree-wrapper compound">
83
<li class="toctree-l1"><a class="reference internal" href="sys.html">29.1. <code class="docutils literal"><span class="pre">sys</span></code> — System-specific parameters and functions</a></li>
84
<li class="toctree-l1"><a class="reference internal" href="sysconfig.html">29.2. <code class="docutils literal"><span class="pre">sysconfig</span></code> — Provide access to Python’s configuration information</a><ul>
85
<li class="toctree-l2"><a class="reference internal" href="sysconfig.html#configuration-variables">29.2.1. Configuration variables</a></li>
86
<li class="toctree-l2"><a class="reference internal" href="sysconfig.html#installation-paths">29.2.2. Installation paths</a></li>
87
<li class="toctree-l2"><a class="reference internal" href="sysconfig.html#other-functions">29.2.3. Other functions</a></li>
88
<li class="toctree-l2"><a class="reference internal" href="sysconfig.html#using-sysconfig-as-a-script">29.2.4. Using <code class="docutils literal"><span class="pre">sysconfig</span></code> as a script</a></li>
91
<li class="toctree-l1"><a class="reference internal" href="builtins.html">29.3. <code class="docutils literal"><span class="pre">builtins</span></code> — Built-in objects</a></li>
92
<li class="toctree-l1"><a class="reference internal" href="__main__.html">29.4. <code class="docutils literal"><span class="pre">__main__</span></code> — Top-level script environment</a></li>
93
<li class="toctree-l1"><a class="reference internal" href="warnings.html">29.5. <code class="docutils literal"><span class="pre">warnings</span></code> — Warning control</a><ul>
94
<li class="toctree-l2"><a class="reference internal" href="warnings.html#warning-categories">29.5.1. Warning Categories</a></li>
95
<li class="toctree-l2"><a class="reference internal" href="warnings.html#the-warnings-filter">29.5.2. The Warnings Filter</a><ul>
96
<li class="toctree-l3"><a class="reference internal" href="warnings.html#default-warning-filters">29.5.2.1. Default Warning Filters</a></li>
99
<li class="toctree-l2"><a class="reference internal" href="warnings.html#temporarily-suppressing-warnings">29.5.3. Temporarily Suppressing Warnings</a></li>
100
<li class="toctree-l2"><a class="reference internal" href="warnings.html#testing-warnings">29.5.4. Testing Warnings</a></li>
101
<li class="toctree-l2"><a class="reference internal" href="warnings.html#updating-code-for-new-versions-of-python">29.5.5. Updating Code For New Versions of Python</a></li>
102
<li class="toctree-l2"><a class="reference internal" href="warnings.html#available-functions">29.5.6. Available Functions</a></li>
103
<li class="toctree-l2"><a class="reference internal" href="warnings.html#available-context-managers">29.5.7. Available Context Managers</a></li>
106
<li class="toctree-l1"><a class="reference internal" href="contextlib.html">29.6. <code class="docutils literal"><span class="pre">contextlib</span></code> — Utilities for <code class="docutils literal"><span class="pre">with</span></code>-statement contexts</a><ul>
107
<li class="toctree-l2"><a class="reference internal" href="contextlib.html#utilities">29.6.1. Utilities</a></li>
108
<li class="toctree-l2"><a class="reference internal" href="contextlib.html#examples-and-recipes">29.6.2. Examples and Recipes</a><ul>
109
<li class="toctree-l3"><a class="reference internal" href="contextlib.html#supporting-a-variable-number-of-context-managers">29.6.2.1. Supporting a variable number of context managers</a></li>
110
<li class="toctree-l3"><a class="reference internal" href="contextlib.html#simplifying-support-for-single-optional-context-managers">29.6.2.2. Simplifying support for single optional context managers</a></li>
111
<li class="toctree-l3"><a class="reference internal" href="contextlib.html#catching-exceptions-from-enter-methods">29.6.2.3. Catching exceptions from <code class="docutils literal"><span class="pre">__enter__</span></code> methods</a></li>
112
<li class="toctree-l3"><a class="reference internal" href="contextlib.html#cleaning-up-in-an-enter-implementation">29.6.2.4. Cleaning up in an <code class="docutils literal"><span class="pre">__enter__</span></code> implementation</a></li>
113
<li class="toctree-l3"><a class="reference internal" href="contextlib.html#replacing-any-use-of-try-finally-and-flag-variables">29.6.2.5. Replacing any use of <code class="docutils literal"><span class="pre">try-finally</span></code> and flag variables</a></li>
114
<li class="toctree-l3"><a class="reference internal" href="contextlib.html#using-a-context-manager-as-a-function-decorator">29.6.2.6. Using a context manager as a function decorator</a></li>
117
<li class="toctree-l2"><a class="reference internal" href="contextlib.html#single-use-reusable-and-reentrant-context-managers">29.6.3. Single use, reusable and reentrant context managers</a><ul>
118
<li class="toctree-l3"><a class="reference internal" href="contextlib.html#reentrant-context-managers">29.6.3.1. Reentrant context managers</a></li>
119
<li class="toctree-l3"><a class="reference internal" href="contextlib.html#reusable-context-managers">29.6.3.2. Reusable context managers</a></li>
124
<li class="toctree-l1"><a class="reference internal" href="abc.html">29.7. <code class="docutils literal"><span class="pre">abc</span></code> — Abstract Base Classes</a></li>
125
<li class="toctree-l1"><a class="reference internal" href="atexit.html">29.8. <code class="docutils literal"><span class="pre">atexit</span></code> — Exit handlers</a><ul>
126
<li class="toctree-l2"><a class="reference internal" href="atexit.html#atexit-example">29.8.1. <code class="docutils literal"><span class="pre">atexit</span></code> Example</a></li>
129
<li class="toctree-l1"><a class="reference internal" href="traceback.html">29.9. <code class="docutils literal"><span class="pre">traceback</span></code> — Print or retrieve a stack traceback</a><ul>
130
<li class="toctree-l2"><a class="reference internal" href="traceback.html#tracebackexception-objects">29.9.1. <code class="docutils literal"><span class="pre">TracebackException</span></code> Objects</a></li>
131
<li class="toctree-l2"><a class="reference internal" href="traceback.html#stacksummary-objects">29.9.2. <code class="docutils literal"><span class="pre">StackSummary</span></code> Objects</a></li>
132
<li class="toctree-l2"><a class="reference internal" href="traceback.html#framesummary-objects">29.9.3. <code class="docutils literal"><span class="pre">FrameSummary</span></code> Objects</a></li>
133
<li class="toctree-l2"><a class="reference internal" href="traceback.html#traceback-examples">29.9.4. Traceback Examples</a></li>
136
<li class="toctree-l1"><a class="reference internal" href="__future__.html">29.10. <code class="docutils literal"><span class="pre">__future__</span></code> — Future statement definitions</a></li>
137
<li class="toctree-l1"><a class="reference internal" href="gc.html">29.11. <code class="docutils literal"><span class="pre">gc</span></code> — Garbage Collector interface</a></li>
138
<li class="toctree-l1"><a class="reference internal" href="inspect.html">29.12. <code class="docutils literal"><span class="pre">inspect</span></code> — Inspect live objects</a><ul>
139
<li class="toctree-l2"><a class="reference internal" href="inspect.html#types-and-members">29.12.1. Types and members</a></li>
140
<li class="toctree-l2"><a class="reference internal" href="inspect.html#retrieving-source-code">29.12.2. Retrieving source code</a></li>
141
<li class="toctree-l2"><a class="reference internal" href="inspect.html#introspecting-callables-with-the-signature-object">29.12.3. Introspecting callables with the Signature object</a></li>
142
<li class="toctree-l2"><a class="reference internal" href="inspect.html#classes-and-functions">29.12.4. Classes and functions</a></li>
143
<li class="toctree-l2"><a class="reference internal" href="inspect.html#the-interpreter-stack">29.12.5. The interpreter stack</a></li>
144
<li class="toctree-l2"><a class="reference internal" href="inspect.html#fetching-attributes-statically">29.12.6. Fetching attributes statically</a></li>
145
<li class="toctree-l2"><a class="reference internal" href="inspect.html#current-state-of-generators-and-coroutines">29.12.7. Current State of Generators and Coroutines</a></li>
146
<li class="toctree-l2"><a class="reference internal" href="inspect.html#command-line-interface">29.12.8. Command Line Interface</a></li>
149
<li class="toctree-l1"><a class="reference internal" href="site.html">29.13. <code class="docutils literal"><span class="pre">site</span></code> — Site-specific configuration hook</a><ul>
150
<li class="toctree-l2"><a class="reference internal" href="site.html#readline-configuration">29.13.1. Readline configuration</a></li>
151
<li class="toctree-l2"><a class="reference internal" href="site.html#module-contents">29.13.2. Module contents</a></li>
154
<li class="toctree-l1"><a class="reference internal" href="fpectl.html">29.14. <code class="docutils literal"><span class="pre">fpectl</span></code> — Floating point exception control</a><ul>
155
<li class="toctree-l2"><a class="reference internal" href="fpectl.html#example">29.14.1. Example</a></li>
156
<li class="toctree-l2"><a class="reference internal" href="fpectl.html#limitations-and-other-considerations">29.14.2. Limitations and other considerations</a></li>
167
<div class="sphinxsidebar" role="navigation" aria-label="main navigation">
168
<div class="sphinxsidebarwrapper">
169
<h4>Previous topic</h4>
170
<p class="topless"><a href="zipapp.html"
171
title="previous chapter">28.4. <code class="docutils literal"><span class="pre">zipapp</span></code> — Manage executable python zip archives</a></p>
173
<p class="topless"><a href="sys.html"
174
title="next chapter">29.1. <code class="docutils literal"><span class="pre">sys</span></code> — System-specific parameters and functions</a></p>
176
<ul class="this-page-menu">
177
<li><a href="../bugs.html">Report a Bug</a></li>
178
<li><a href="../_sources/library/python.txt"
179
rel="nofollow">Show Source</a></li>
182
<div id="searchbox" style="display: none" role="search">
183
<h3>Quick search</h3>
184
<form class="search" action="../search.html" method="get">
185
<input type="text" name="q" />
186
<input type="submit" value="Go" />
187
<input type="hidden" name="check_keywords" value="yes" />
188
<input type="hidden" name="area" value="default" />
190
<p class="searchtip" style="font-size: 90%">
191
Enter search terms or a module, class or function name.
194
<script type="text/javascript">$('#searchbox').show(0);</script>
197
<div class="clearer"></div>
199
<div class="related" role="navigation" aria-label="related navigation">
202
<li class="right" style="margin-right: 10px">
203
<a href="../genindex.html" title="General Index"
206
<a href="../py-modindex.html" title="Python Module Index"
209
<a href="sys.html" title="29.1. sys — System-specific parameters and functions"
212
<a href="zipapp.html" title="28.4. zipapp — Manage executable python zip archives"
214
<li><img src="../_static/py.png" alt=""
215
style="vertical-align: middle; margin-top: -1px"/></li>
216
<li><a href="https://www.python.org/">Python</a> »</li>
218
<span class="version_switcher_placeholder">3.5.1</span>
219
<a href="../index.html">Documentation </a> »
222
<li class="nav-item nav-item-1"><a href="index.html" >The Python Standard Library</a> »</li>
226
© <a href="../copyright.html">Copyright</a> 1990-2016, Python Software Foundation.
228
The Python Software Foundation is a non-profit corporation.
229
<a href="https://www.python.org/psf/donations/">Please donate.</a>
231
Last updated on Jan 22, 2016.
232
<a href="../bugs.html">Found a bug</a>?
234
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.3.3.
b'\\ No newline at end of file'