~dkuhlman/python-training-materials/Materials

« back to all changes in this revision

Viewing changes to python-3.5.2-docs-html/library/platform.html

  • Committer: Dave Kuhlman
  • Date: 2017-04-15 16:24:56 UTC
  • Revision ID: dkuhlman@davekuhlman.org-20170415162456-iav9vozzg4iwqwv3
Updated docs

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 
2
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
3
 
 
4
 
 
5
<html xmlns="http://www.w3.org/1999/xhtml">
 
6
  <head>
 
7
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 
8
    
 
9
    <title>16.14. platform — Access to underlying platform’s identifying data &mdash; Python 3.5.2 documentation</title>
 
10
    
 
11
    <link rel="stylesheet" href="../_static/pydoctheme.css" type="text/css" />
 
12
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
 
13
    
 
14
    <script type="text/javascript">
 
15
      var DOCUMENTATION_OPTIONS = {
 
16
        URL_ROOT:    '../',
 
17
        VERSION:     '3.5.2',
 
18
        COLLAPSE_INDEX: false,
 
19
        FILE_SUFFIX: '.html',
 
20
        HAS_SOURCE:  true
 
21
      };
 
22
    </script>
 
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.2 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.2 documentation" href="../contents.html" />
 
33
    <link rel="up" title="16. Generic Operating System Services" href="allos.html" />
 
34
    <link rel="next" title="16.15. errno — Standard errno system symbols" href="errno.html" />
 
35
    <link rel="prev" title="16.13. curses.panel — A panel stack extension for curses" href="curses.panel.html" />
 
36
    <link rel="shortcut icon" type="image/png" href="../_static/py.png" />
 
37
    
 
38
    <script type="text/javascript" src="../_static/copybutton.js"></script>
 
39
    <script type="text/javascript" src="../_static/version_switch.js"></script>
 
40
    
 
41
    
 
42
 
 
43
 
 
44
  </head>
 
45
  <body role="document">  
 
46
    <div class="related" role="navigation" aria-label="related navigation">
 
47
      <h3>Navigation</h3>
 
48
      <ul>
 
49
        <li class="right" style="margin-right: 10px">
 
50
          <a href="../genindex.html" title="General Index"
 
51
             accesskey="I">index</a></li>
 
52
        <li class="right" >
 
53
          <a href="../py-modindex.html" title="Python Module Index"
 
54
             >modules</a> |</li>
 
55
        <li class="right" >
 
56
          <a href="errno.html" title="16.15. errno — Standard errno system symbols"
 
57
             accesskey="N">next</a> |</li>
 
58
        <li class="right" >
 
59
          <a href="curses.panel.html" title="16.13. curses.panel — A panel stack extension for curses"
 
60
             accesskey="P">previous</a> |</li>
 
61
        <li><img src="../_static/py.png" alt=""
 
62
                 style="vertical-align: middle; margin-top: -1px"/></li>
 
63
        <li><a href="https://www.python.org/">Python</a> &raquo;</li>
 
64
        <li>
 
65
          <span class="version_switcher_placeholder">3.5.2</span>
 
66
          <a href="../index.html">Documentation </a> &raquo;
 
67
        </li>
 
68
 
 
69
          <li class="nav-item nav-item-1"><a href="index.html" >The Python Standard Library</a> &raquo;</li>
 
70
          <li class="nav-item nav-item-2"><a href="allos.html" accesskey="U">16. Generic Operating System Services</a> &raquo;</li>
 
71
    <li class="right">
 
72
        
 
73
 
 
74
    <div class="inline-search" style="display: none" role="search">
 
75
        <form class="inline-search" action="../search.html" method="get">
 
76
          <input placeholder="Quick search" type="text" name="q" />
 
77
          <input type="submit" value="Go" />
 
78
          <input type="hidden" name="check_keywords" value="yes" />
 
79
          <input type="hidden" name="area" value="default" />
 
80
        </form>
 
81
    </div>
 
82
    <script type="text/javascript">$('.inline-search').show(0);</script>
 
83
         |
 
84
    </li>
 
85
 
 
86
      </ul>
 
87
    </div>    
 
88
 
 
89
    <div class="document">
 
90
      <div class="documentwrapper">
 
91
        <div class="bodywrapper">
 
92
          <div class="body" role="main">
 
93
            
 
94
  <div class="section" id="module-platform">
 
95
<span id="platform-access-to-underlying-platform-s-identifying-data"></span><h1>16.14. <a class="reference internal" href="#module-platform" title="platform: Retrieves as much platform identifying data as possible."><code class="xref py py-mod docutils literal"><span class="pre">platform</span></code></a> &#8212;  Access to underlying platform&#8217;s identifying data<a class="headerlink" href="#module-platform" title="Permalink to this headline">¶</a></h1>
 
96
<p><strong>Source code:</strong> <a class="reference external" href="https://hg.python.org/cpython/file/3.5/Lib/platform.py">Lib/platform.py</a></p>
 
97
<hr class="docutils" />
 
98
<div class="admonition note">
 
99
<p class="first admonition-title">Note</p>
 
100
<p class="last">Specific platforms listed alphabetically, with Linux included in the Unix
 
101
section.</p>
 
102
</div>
 
103
<div class="section" id="cross-platform">
 
104
<h2>16.14.1. Cross Platform<a class="headerlink" href="#cross-platform" title="Permalink to this headline">¶</a></h2>
 
105
<dl class="function">
 
106
<dt id="platform.architecture">
 
107
<code class="descclassname">platform.</code><code class="descname">architecture</code><span class="sig-paren">(</span><em>executable=sys.executable</em>, <em>bits=''</em>, <em>linkage=''</em><span class="sig-paren">)</span><a class="headerlink" href="#platform.architecture" title="Permalink to this definition">¶</a></dt>
 
108
<dd><p>Queries the given executable (defaults to the Python interpreter binary) for
 
109
various architecture information.</p>
 
110
<p>Returns a tuple <code class="docutils literal"><span class="pre">(bits,</span> <span class="pre">linkage)</span></code> which contain information about the bit
 
111
architecture and the linkage format used for the executable. Both values are
 
112
returned as strings.</p>
 
113
<p>Values that cannot be determined are returned as given by the parameter presets.
 
114
If bits is given as <code class="docutils literal"><span class="pre">''</span></code>, the <code class="docutils literal"><span class="pre">sizeof(pointer)</span></code> (or
 
115
<code class="docutils literal"><span class="pre">sizeof(long)</span></code> on Python version &lt; 1.5.2) is used as indicator for the
 
116
supported pointer size.</p>
 
117
<p>The function relies on the system&#8217;s <code class="file docutils literal"><span class="pre">file</span></code> command to do the actual work.
 
118
This is available on most if not all Unix  platforms and some non-Unix platforms
 
119
and then only if the executable points to the Python interpreter.  Reasonable
 
120
defaults are used when the above needs are not met.</p>
 
121
<div class="admonition note">
 
122
<p class="first admonition-title">Note</p>
 
123
<p>On Mac OS X (and perhaps other platforms), executable files may be
 
124
universal files containing multiple architectures.</p>
 
125
<p>To get at the &#8220;64-bitness&#8221; of the current interpreter, it is more
 
126
reliable to query the <a class="reference internal" href="sys.html#sys.maxsize" title="sys.maxsize"><code class="xref py py-attr docutils literal"><span class="pre">sys.maxsize</span></code></a> attribute:</p>
 
127
<div class="last highlight-python3"><div class="highlight"><pre><span></span><span class="n">is_64bits</span> <span class="o">=</span> <span class="n">sys</span><span class="o">.</span><span class="n">maxsize</span> <span class="o">&gt;</span> <span class="mi">2</span><span class="o">**</span><span class="mi">32</span>
 
128
</pre></div>
 
129
</div>
 
130
</div>
 
131
</dd></dl>
 
132
 
 
133
<dl class="function">
 
134
<dt id="platform.machine">
 
135
<code class="descclassname">platform.</code><code class="descname">machine</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#platform.machine" title="Permalink to this definition">¶</a></dt>
 
136
<dd><p>Returns the machine type, e.g. <code class="docutils literal"><span class="pre">'i386'</span></code>. An empty string is returned if the
 
137
value cannot be determined.</p>
 
138
</dd></dl>
 
139
 
 
140
<dl class="function">
 
141
<dt id="platform.node">
 
142
<code class="descclassname">platform.</code><code class="descname">node</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#platform.node" title="Permalink to this definition">¶</a></dt>
 
143
<dd><p>Returns the computer&#8217;s network name (may not be fully qualified!). An empty
 
144
string is returned if the value cannot be determined.</p>
 
145
</dd></dl>
 
146
 
 
147
<dl class="function">
 
148
<dt id="platform.platform">
 
149
<code class="descclassname">platform.</code><code class="descname">platform</code><span class="sig-paren">(</span><em>aliased=0</em>, <em>terse=0</em><span class="sig-paren">)</span><a class="headerlink" href="#platform.platform" title="Permalink to this definition">¶</a></dt>
 
150
<dd><p>Returns a single string identifying the underlying platform with as much useful
 
151
information as possible.</p>
 
152
<p>The output is intended to be <em>human readable</em> rather than machine parseable. It
 
153
may look different on different platforms and this is intended.</p>
 
154
<p>If <em>aliased</em> is true, the function will use aliases for various platforms that
 
155
report system names which differ from their common names, for example SunOS will
 
156
be reported as Solaris.  The <a class="reference internal" href="#platform.system_alias" title="platform.system_alias"><code class="xref py py-func docutils literal"><span class="pre">system_alias()</span></code></a> function is used to implement
 
157
this.</p>
 
158
<p>Setting <em>terse</em> to true causes the function to return only the absolute minimum
 
159
information needed to identify the platform.</p>
 
160
</dd></dl>
 
161
 
 
162
<dl class="function">
 
163
<dt id="platform.processor">
 
164
<code class="descclassname">platform.</code><code class="descname">processor</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#platform.processor" title="Permalink to this definition">¶</a></dt>
 
165
<dd><p>Returns the (real) processor name, e.g. <code class="docutils literal"><span class="pre">'amdk6'</span></code>.</p>
 
166
<p>An empty string is returned if the value cannot be determined. Note that many
 
167
platforms do not provide this information or simply return the same value as for
 
168
<a class="reference internal" href="#platform.machine" title="platform.machine"><code class="xref py py-func docutils literal"><span class="pre">machine()</span></code></a>.  NetBSD does this.</p>
 
169
</dd></dl>
 
170
 
 
171
<dl class="function">
 
172
<dt id="platform.python_build">
 
173
<code class="descclassname">platform.</code><code class="descname">python_build</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#platform.python_build" title="Permalink to this definition">¶</a></dt>
 
174
<dd><p>Returns a tuple <code class="docutils literal"><span class="pre">(buildno,</span> <span class="pre">builddate)</span></code> stating the Python build number and
 
175
date as strings.</p>
 
176
</dd></dl>
 
177
 
 
178
<dl class="function">
 
179
<dt id="platform.python_compiler">
 
180
<code class="descclassname">platform.</code><code class="descname">python_compiler</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#platform.python_compiler" title="Permalink to this definition">¶</a></dt>
 
181
<dd><p>Returns a string identifying the compiler used for compiling Python.</p>
 
182
</dd></dl>
 
183
 
 
184
<dl class="function">
 
185
<dt id="platform.python_branch">
 
186
<code class="descclassname">platform.</code><code class="descname">python_branch</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#platform.python_branch" title="Permalink to this definition">¶</a></dt>
 
187
<dd><p>Returns a string identifying the Python implementation SCM branch.</p>
 
188
</dd></dl>
 
189
 
 
190
<dl class="function">
 
191
<dt id="platform.python_implementation">
 
192
<code class="descclassname">platform.</code><code class="descname">python_implementation</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#platform.python_implementation" title="Permalink to this definition">¶</a></dt>
 
193
<dd><p>Returns a string identifying the Python implementation. Possible return values
 
194
are: &#8216;CPython&#8217;, &#8216;IronPython&#8217;, &#8216;Jython&#8217;, &#8216;PyPy&#8217;.</p>
 
195
</dd></dl>
 
196
 
 
197
<dl class="function">
 
198
<dt id="platform.python_revision">
 
199
<code class="descclassname">platform.</code><code class="descname">python_revision</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#platform.python_revision" title="Permalink to this definition">¶</a></dt>
 
200
<dd><p>Returns a string identifying the Python implementation SCM revision.</p>
 
201
</dd></dl>
 
202
 
 
203
<dl class="function">
 
204
<dt id="platform.python_version">
 
205
<code class="descclassname">platform.</code><code class="descname">python_version</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#platform.python_version" title="Permalink to this definition">¶</a></dt>
 
206
<dd><p>Returns the Python version as string <code class="docutils literal"><span class="pre">'major.minor.patchlevel'</span></code>.</p>
 
207
<p>Note that unlike the Python <code class="docutils literal"><span class="pre">sys.version</span></code>, the returned value will always
 
208
include the patchlevel (it defaults to 0).</p>
 
209
</dd></dl>
 
210
 
 
211
<dl class="function">
 
212
<dt id="platform.python_version_tuple">
 
213
<code class="descclassname">platform.</code><code class="descname">python_version_tuple</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#platform.python_version_tuple" title="Permalink to this definition">¶</a></dt>
 
214
<dd><p>Returns the Python version as tuple <code class="docutils literal"><span class="pre">(major,</span> <span class="pre">minor,</span> <span class="pre">patchlevel)</span></code> of strings.</p>
 
215
<p>Note that unlike the Python <code class="docutils literal"><span class="pre">sys.version</span></code>, the returned value will always
 
216
include the patchlevel (it defaults to <code class="docutils literal"><span class="pre">'0'</span></code>).</p>
 
217
</dd></dl>
 
218
 
 
219
<dl class="function">
 
220
<dt id="platform.release">
 
221
<code class="descclassname">platform.</code><code class="descname">release</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#platform.release" title="Permalink to this definition">¶</a></dt>
 
222
<dd><p>Returns the system&#8217;s release, e.g. <code class="docutils literal"><span class="pre">'2.2.0'</span></code> or <code class="docutils literal"><span class="pre">'NT'</span></code> An empty string is
 
223
returned if the value cannot be determined.</p>
 
224
</dd></dl>
 
225
 
 
226
<dl class="function">
 
227
<dt id="platform.system">
 
228
<code class="descclassname">platform.</code><code class="descname">system</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#platform.system" title="Permalink to this definition">¶</a></dt>
 
229
<dd><p>Returns the system/OS name, e.g. <code class="docutils literal"><span class="pre">'Linux'</span></code>, <code class="docutils literal"><span class="pre">'Windows'</span></code>, or <code class="docutils literal"><span class="pre">'Java'</span></code>. An
 
230
empty string is returned if the value cannot be determined.</p>
 
231
</dd></dl>
 
232
 
 
233
<dl class="function">
 
234
<dt id="platform.system_alias">
 
235
<code class="descclassname">platform.</code><code class="descname">system_alias</code><span class="sig-paren">(</span><em>system</em>, <em>release</em>, <em>version</em><span class="sig-paren">)</span><a class="headerlink" href="#platform.system_alias" title="Permalink to this definition">¶</a></dt>
 
236
<dd><p>Returns <code class="docutils literal"><span class="pre">(system,</span> <span class="pre">release,</span> <span class="pre">version)</span></code> aliased to common marketing names used
 
237
for some systems.  It also does some reordering of the information in some cases
 
238
where it would otherwise cause confusion.</p>
 
239
</dd></dl>
 
240
 
 
241
<dl class="function">
 
242
<dt id="platform.version">
 
243
<code class="descclassname">platform.</code><code class="descname">version</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#platform.version" title="Permalink to this definition">¶</a></dt>
 
244
<dd><p>Returns the system&#8217;s release version, e.g. <code class="docutils literal"><span class="pre">'#3</span> <span class="pre">on</span> <span class="pre">degas'</span></code>. An empty string is
 
245
returned if the value cannot be determined.</p>
 
246
</dd></dl>
 
247
 
 
248
<dl class="function">
 
249
<dt id="platform.uname">
 
250
<code class="descclassname">platform.</code><code class="descname">uname</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#platform.uname" title="Permalink to this definition">¶</a></dt>
 
251
<dd><p>Fairly portable uname interface. Returns a <a class="reference internal" href="collections.html#collections.namedtuple" title="collections.namedtuple"><code class="xref py py-func docutils literal"><span class="pre">namedtuple()</span></code></a>
 
252
containing six attributes: <a class="reference internal" href="#platform.system" title="platform.system"><code class="xref py py-attr docutils literal"><span class="pre">system</span></code></a>, <a class="reference internal" href="#platform.node" title="platform.node"><code class="xref py py-attr docutils literal"><span class="pre">node</span></code></a>, <a class="reference internal" href="#platform.release" title="platform.release"><code class="xref py py-attr docutils literal"><span class="pre">release</span></code></a>,
 
253
<a class="reference internal" href="#platform.version" title="platform.version"><code class="xref py py-attr docutils literal"><span class="pre">version</span></code></a>, <a class="reference internal" href="#platform.machine" title="platform.machine"><code class="xref py py-attr docutils literal"><span class="pre">machine</span></code></a>, and <a class="reference internal" href="#platform.processor" title="platform.processor"><code class="xref py py-attr docutils literal"><span class="pre">processor</span></code></a>.</p>
 
254
<p>Note that this adds a sixth attribute (<a class="reference internal" href="#platform.processor" title="platform.processor"><code class="xref py py-attr docutils literal"><span class="pre">processor</span></code></a>) not present
 
255
in the <a class="reference internal" href="os.html#os.uname" title="os.uname"><code class="xref py py-func docutils literal"><span class="pre">os.uname()</span></code></a> result.  Also, the attribute names are different
 
256
for the first two attributes; <a class="reference internal" href="os.html#os.uname" title="os.uname"><code class="xref py py-func docutils literal"><span class="pre">os.uname()</span></code></a> names them
 
257
<code class="xref py py-attr docutils literal"><span class="pre">sysname</span></code> and <code class="xref py py-attr docutils literal"><span class="pre">nodename</span></code>.</p>
 
258
<p>Entries which cannot be determined are set to <code class="docutils literal"><span class="pre">''</span></code>.</p>
 
259
<div class="versionchanged">
 
260
<p><span class="versionmodified">Changed in version 3.3: </span>Result changed from a tuple to a namedtuple.</p>
 
261
</div>
 
262
</dd></dl>
 
263
 
 
264
</div>
 
265
<div class="section" id="java-platform">
 
266
<h2>16.14.2. Java Platform<a class="headerlink" href="#java-platform" title="Permalink to this headline">¶</a></h2>
 
267
<dl class="function">
 
268
<dt id="platform.java_ver">
 
269
<code class="descclassname">platform.</code><code class="descname">java_ver</code><span class="sig-paren">(</span><em>release=''</em>, <em>vendor=''</em>, <em>vminfo=(''</em>, <em>''</em>, <em>'')</em>, <em>osinfo=(''</em>, <em>''</em>, <em>'')</em><span class="sig-paren">)</span><a class="headerlink" href="#platform.java_ver" title="Permalink to this definition">¶</a></dt>
 
270
<dd><p>Version interface for Jython.</p>
 
271
<p>Returns a tuple <code class="docutils literal"><span class="pre">(release,</span> <span class="pre">vendor,</span> <span class="pre">vminfo,</span> <span class="pre">osinfo)</span></code> with <em>vminfo</em> being a
 
272
tuple <code class="docutils literal"><span class="pre">(vm_name,</span> <span class="pre">vm_release,</span> <span class="pre">vm_vendor)</span></code> and <em>osinfo</em> being a tuple
 
273
<code class="docutils literal"><span class="pre">(os_name,</span> <span class="pre">os_version,</span> <span class="pre">os_arch)</span></code>. Values which cannot be determined are set to
 
274
the defaults given as parameters (which all default to <code class="docutils literal"><span class="pre">''</span></code>).</p>
 
275
</dd></dl>
 
276
 
 
277
</div>
 
278
<div class="section" id="windows-platform">
 
279
<h2>16.14.3. Windows Platform<a class="headerlink" href="#windows-platform" title="Permalink to this headline">¶</a></h2>
 
280
<dl class="function">
 
281
<dt id="platform.win32_ver">
 
282
<code class="descclassname">platform.</code><code class="descname">win32_ver</code><span class="sig-paren">(</span><em>release=''</em>, <em>version=''</em>, <em>csd=''</em>, <em>ptype=''</em><span class="sig-paren">)</span><a class="headerlink" href="#platform.win32_ver" title="Permalink to this definition">¶</a></dt>
 
283
<dd><p>Get additional version information from the Windows Registry and return a tuple
 
284
<code class="docutils literal"><span class="pre">(release,</span> <span class="pre">version,</span> <span class="pre">csd,</span> <span class="pre">ptype)</span></code> referring to OS release, version number,
 
285
CSD level (service pack) and OS type (multi/single processor).</p>
 
286
<p>As a hint: <em>ptype</em> is <code class="docutils literal"><span class="pre">'Uniprocessor</span> <span class="pre">Free'</span></code> on single processor NT machines
 
287
and <code class="docutils literal"><span class="pre">'Multiprocessor</span> <span class="pre">Free'</span></code> on multi processor machines. The <em>&#8216;Free&#8217;</em> refers
 
288
to the OS version being free of debugging code. It could also state <em>&#8216;Checked&#8217;</em>
 
289
which means the OS version uses debugging code, i.e. code that checks arguments,
 
290
ranges, etc.</p>
 
291
<div class="admonition note">
 
292
<p class="first admonition-title">Note</p>
 
293
<p class="last">This function works best with Mark Hammond&#8217;s
 
294
<code class="xref py py-mod docutils literal"><span class="pre">win32all</span></code> package installed, but also on Python 2.3 and
 
295
later (support for this was added in Python 2.6). It obviously
 
296
only runs on Win32 compatible platforms.</p>
 
297
</div>
 
298
</dd></dl>
 
299
 
 
300
<div class="section" id="win95-98-specific">
 
301
<h3>16.14.3.1. Win95/98 specific<a class="headerlink" href="#win95-98-specific" title="Permalink to this headline">¶</a></h3>
 
302
<dl class="function">
 
303
<dt id="platform.popen">
 
304
<code class="descclassname">platform.</code><code class="descname">popen</code><span class="sig-paren">(</span><em>cmd</em>, <em>mode='r'</em>, <em>bufsize=-1</em><span class="sig-paren">)</span><a class="headerlink" href="#platform.popen" title="Permalink to this definition">¶</a></dt>
 
305
<dd><p>Portable <a class="reference internal" href="#platform.popen" title="platform.popen"><code class="xref py py-func docutils literal"><span class="pre">popen()</span></code></a> interface.  Find a working popen implementation
 
306
preferring <code class="xref py py-func docutils literal"><span class="pre">win32pipe.popen()</span></code>.  On Windows NT, <code class="xref py py-func docutils literal"><span class="pre">win32pipe.popen()</span></code>
 
307
should work; on Windows 9x it hangs due to bugs in the MS C library.</p>
 
308
<div class="deprecated">
 
309
<p><span class="versionmodified">Deprecated since version 3.3: </span>This function is obsolete.  Use the <a class="reference internal" href="subprocess.html#module-subprocess" title="subprocess: Subprocess management."><code class="xref py py-mod docutils literal"><span class="pre">subprocess</span></code></a> module.  Check
 
310
especially the <a class="reference internal" href="subprocess.html#subprocess-replacements"><span>Replacing Older Functions with the subprocess Module</span></a> section.</p>
 
311
</div>
 
312
</dd></dl>
 
313
 
 
314
</div>
 
315
</div>
 
316
<div class="section" id="mac-os-platform">
 
317
<h2>16.14.4. Mac OS Platform<a class="headerlink" href="#mac-os-platform" title="Permalink to this headline">¶</a></h2>
 
318
<dl class="function">
 
319
<dt id="platform.mac_ver">
 
320
<code class="descclassname">platform.</code><code class="descname">mac_ver</code><span class="sig-paren">(</span><em>release=''</em>, <em>versioninfo=(''</em>, <em>''</em>, <em>'')</em>, <em>machine=''</em><span class="sig-paren">)</span><a class="headerlink" href="#platform.mac_ver" title="Permalink to this definition">¶</a></dt>
 
321
<dd><p>Get Mac OS version information and return it as tuple <code class="docutils literal"><span class="pre">(release,</span> <span class="pre">versioninfo,</span>
 
322
<span class="pre">machine)</span></code> with <em>versioninfo</em> being a tuple <code class="docutils literal"><span class="pre">(version,</span> <span class="pre">dev_stage,</span>
 
323
<span class="pre">non_release_version)</span></code>.</p>
 
324
<p>Entries which cannot be determined are set to <code class="docutils literal"><span class="pre">''</span></code>.  All tuple entries are
 
325
strings.</p>
 
326
</dd></dl>
 
327
 
 
328
</div>
 
329
<div class="section" id="unix-platforms">
 
330
<h2>16.14.5. Unix Platforms<a class="headerlink" href="#unix-platforms" title="Permalink to this headline">¶</a></h2>
 
331
<dl class="function">
 
332
<dt id="platform.dist">
 
333
<code class="descclassname">platform.</code><code class="descname">dist</code><span class="sig-paren">(</span><em>distname=''</em>, <em>version=''</em>, <em>id=''</em>, <em>supported_dists=('SuSE'</em>, <em>'debian'</em>, <em>'redhat'</em>, <em>'mandrake'</em>, <em>...)</em><span class="sig-paren">)</span><a class="headerlink" href="#platform.dist" title="Permalink to this definition">¶</a></dt>
 
334
<dd><p>This is another name for <a class="reference internal" href="#platform.linux_distribution" title="platform.linux_distribution"><code class="xref py py-func docutils literal"><span class="pre">linux_distribution()</span></code></a>.</p>
 
335
<div class="deprecated-removed">
 
336
<p><span class="versionmodified">Deprecated since version 3.5, will be removed in version 3.7.</span></p>
 
337
</div>
 
338
</dd></dl>
 
339
 
 
340
<dl class="function">
 
341
<dt id="platform.linux_distribution">
 
342
<code class="descclassname">platform.</code><code class="descname">linux_distribution</code><span class="sig-paren">(</span><em>distname=''</em>, <em>version=''</em>, <em>id=''</em>, <em>supported_dists=('SuSE'</em>, <em>'debian'</em>, <em>'redhat'</em>, <em>'mandrake'</em>, <em>...)</em>, <em>full_distribution_name=1</em><span class="sig-paren">)</span><a class="headerlink" href="#platform.linux_distribution" title="Permalink to this definition">¶</a></dt>
 
343
<dd><p>Tries to determine the name of the Linux OS distribution name.</p>
 
344
<p><code class="docutils literal"><span class="pre">supported_dists</span></code> may be given to define the set of Linux distributions to
 
345
look for. It defaults to a list of currently supported Linux distributions
 
346
identified by their release file name.</p>
 
347
<p>If <code class="docutils literal"><span class="pre">full_distribution_name</span></code> is true (default), the full distribution read
 
348
from the OS is returned. Otherwise the short name taken from
 
349
<code class="docutils literal"><span class="pre">supported_dists</span></code> is used.</p>
 
350
<p>Returns a tuple <code class="docutils literal"><span class="pre">(distname,version,id)</span></code> which defaults to the args given as
 
351
parameters.  <code class="docutils literal"><span class="pre">id</span></code> is the item in parentheses after the version number.  It
 
352
is usually the version codename.</p>
 
353
<div class="deprecated-removed">
 
354
<p><span class="versionmodified">Deprecated since version 3.5, will be removed in version 3.7.</span></p>
 
355
</div>
 
356
</dd></dl>
 
357
 
 
358
<dl class="function">
 
359
<dt id="platform.libc_ver">
 
360
<code class="descclassname">platform.</code><code class="descname">libc_ver</code><span class="sig-paren">(</span><em>executable=sys.executable</em>, <em>lib=''</em>, <em>version=''</em>, <em>chunksize=2048</em><span class="sig-paren">)</span><a class="headerlink" href="#platform.libc_ver" title="Permalink to this definition">¶</a></dt>
 
361
<dd><p>Tries to determine the libc version against which the file executable (defaults
 
362
to the Python interpreter) is linked.  Returns a tuple of strings <code class="docutils literal"><span class="pre">(lib,</span>
 
363
<span class="pre">version)</span></code> which default to the given parameters in case the lookup fails.</p>
 
364
<p>Note that this function has intimate knowledge of how different libc versions
 
365
add symbols to the executable is probably only usable for executables compiled
 
366
using <strong class="program">gcc</strong>.</p>
 
367
<p>The file is read and scanned in chunks of <em>chunksize</em> bytes.</p>
 
368
</dd></dl>
 
369
 
 
370
</div>
 
371
</div>
 
372
 
 
373
 
 
374
          </div>
 
375
        </div>
 
376
      </div>
 
377
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
 
378
        <div class="sphinxsidebarwrapper">
 
379
  <h3><a href="../contents.html">Table Of Contents</a></h3>
 
380
  <ul>
 
381
<li><a class="reference internal" href="#">16.14. <code class="docutils literal"><span class="pre">platform</span></code> &#8212;  Access to underlying platform&#8217;s identifying data</a><ul>
 
382
<li><a class="reference internal" href="#cross-platform">16.14.1. Cross Platform</a></li>
 
383
<li><a class="reference internal" href="#java-platform">16.14.2. Java Platform</a></li>
 
384
<li><a class="reference internal" href="#windows-platform">16.14.3. Windows Platform</a><ul>
 
385
<li><a class="reference internal" href="#win95-98-specific">16.14.3.1. Win95/98 specific</a></li>
 
386
</ul>
 
387
</li>
 
388
<li><a class="reference internal" href="#mac-os-platform">16.14.4. Mac OS Platform</a></li>
 
389
<li><a class="reference internal" href="#unix-platforms">16.14.5. Unix Platforms</a></li>
 
390
</ul>
 
391
</li>
 
392
</ul>
 
393
 
 
394
  <h4>Previous topic</h4>
 
395
  <p class="topless"><a href="curses.panel.html"
 
396
                        title="previous chapter">16.13. <code class="docutils literal"><span class="pre">curses.panel</span></code> &#8212; A panel stack extension for curses</a></p>
 
397
  <h4>Next topic</h4>
 
398
  <p class="topless"><a href="errno.html"
 
399
                        title="next chapter">16.15. <code class="docutils literal"><span class="pre">errno</span></code> &#8212; Standard errno system symbols</a></p>
 
400
  <div role="note" aria-label="source link">
 
401
    <h3>This Page</h3>
 
402
    <ul class="this-page-menu">
 
403
      <li><a href="../bugs.html">Report a Bug</a></li>
 
404
      <li><a href="../_sources/library/platform.txt"
 
405
            rel="nofollow">Show Source</a></li>
 
406
    </ul>
 
407
  </div>
 
408
        </div>
 
409
      </div>
 
410
      <div class="clearer"></div>
 
411
    </div>  
 
412
    <div class="related" role="navigation" aria-label="related navigation">
 
413
      <h3>Navigation</h3>
 
414
      <ul>
 
415
        <li class="right" style="margin-right: 10px">
 
416
          <a href="../genindex.html" title="General Index"
 
417
             >index</a></li>
 
418
        <li class="right" >
 
419
          <a href="../py-modindex.html" title="Python Module Index"
 
420
             >modules</a> |</li>
 
421
        <li class="right" >
 
422
          <a href="errno.html" title="16.15. errno — Standard errno system symbols"
 
423
             >next</a> |</li>
 
424
        <li class="right" >
 
425
          <a href="curses.panel.html" title="16.13. curses.panel — A panel stack extension for curses"
 
426
             >previous</a> |</li>
 
427
        <li><img src="../_static/py.png" alt=""
 
428
                 style="vertical-align: middle; margin-top: -1px"/></li>
 
429
        <li><a href="https://www.python.org/">Python</a> &raquo;</li>
 
430
        <li>
 
431
          <span class="version_switcher_placeholder">3.5.2</span>
 
432
          <a href="../index.html">Documentation </a> &raquo;
 
433
        </li>
 
434
 
 
435
          <li class="nav-item nav-item-1"><a href="index.html" >The Python Standard Library</a> &raquo;</li>
 
436
          <li class="nav-item nav-item-2"><a href="allos.html" >16. Generic Operating System Services</a> &raquo;</li>
 
437
    <li class="right">
 
438
        
 
439
 
 
440
    <div class="inline-search" style="display: none" role="search">
 
441
        <form class="inline-search" action="../search.html" method="get">
 
442
          <input placeholder="Quick search" type="text" name="q" />
 
443
          <input type="submit" value="Go" />
 
444
          <input type="hidden" name="check_keywords" value="yes" />
 
445
          <input type="hidden" name="area" value="default" />
 
446
        </form>
 
447
    </div>
 
448
    <script type="text/javascript">$('.inline-search').show(0);</script>
 
449
         |
 
450
    </li>
 
451
 
 
452
      </ul>
 
453
    </div>  
 
454
    <div class="footer">
 
455
    &copy; <a href="../copyright.html">Copyright</a> 2001-2016, Python Software Foundation.
 
456
    <br />
 
457
    The Python Software Foundation is a non-profit corporation.
 
458
    <a href="https://www.python.org/psf/donations/">Please donate.</a>
 
459
    <br />
 
460
    Last updated on Sep 23, 2016.
 
461
    <a href="../bugs.html">Found a bug</a>?
 
462
    <br />
 
463
    Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.3.3.
 
464
    </div>
 
465
 
 
466
  </body>
 
467
</html>
 
 
b'\\ No newline at end of file'