Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / sam-t2 / devtools / v8plus / html / python / lib / node365.html
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<link rel="STYLESHEET" href="lib.css" type='text/css' />
<link rel="SHORTCUT ICON" href="../icons/pyfav.png" type="image/png" />
<link rel='start' href='../index.html' title='Python Documentation Index' />
<link rel="first" href="lib.html" title='Python Library Reference' />
<link rel='contents' href='contents.html' title="Contents" />
<link rel='index' href='genindex.html' title='Index' />
<link rel='last' href='about.html' title='About this document...' />
<link rel='help' href='about.html' title='About this document...' />
<link rel="next" href="node366.html" />
<link rel="prev" href="module-platform.html" />
<link rel="parent" href="module-platform.html" />
<link rel="next" href="node366.html" />
<meta name='aesop' content='information' />
<title>6.30.1 Cross Platform</title>
</head>
<body>
<DIV CLASS="navigation">
<div id='top-navigation-panel' xml:id='top-navigation-panel'>
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td class='online-navigation'><a rel="prev" title="6.30 platform "
href="module-platform.html"><img src='../icons/previous.png'
border='0' height='32' alt='Previous Page' width='32' /></A></td>
<td class='online-navigation'><a rel="parent" title="6.30 platform "
href="module-platform.html"><img src='../icons/up.png'
border='0' height='32' alt='Up One Level' width='32' /></A></td>
<td class='online-navigation'><a rel="next" title="6.30.2 Java Platform"
href="node366.html"><img src='../icons/next.png'
border='0' height='32' alt='Next Page' width='32' /></A></td>
<td align="center" width="100%">Python Library Reference</td>
<td class='online-navigation'><a rel="contents" title="Table of Contents"
href="contents.html"><img src='../icons/contents.png'
border='0' height='32' alt='Contents' width='32' /></A></td>
<td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png'
border='0' height='32' alt='Module Index' width='32' /></a></td>
<td class='online-navigation'><a rel="index" title="Index"
href="genindex.html"><img src='../icons/index.png'
border='0' height='32' alt='Index' width='32' /></A></td>
</tr></table>
<div class='online-navigation'>
<b class="navlabel">Previous:</b>
<a class="sectref" rel="prev" href="module-platform.html">6.30 platform </A>
<b class="navlabel">Up:</b>
<a class="sectref" rel="parent" href="module-platform.html">6.30 platform </A>
<b class="navlabel">Next:</b>
<a class="sectref" rel="next" href="node366.html">6.30.2 Java Platform</A>
</div>
<hr /></div>
</DIV>
<!--End of Navigation Panel-->
<H2><A NAME="SECTION0083010000000000000000">
6.30.1 Cross Platform</A>
</H2>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2567' xml:id='l2h-2567' class="function">architecture</tt></b>(</nobr></td>
<td><var>executable=sys.executable, bits='', linkage=''</var>)</td></tr></table></dt>
<dd>
Queries the given executable (defaults to the Python interpreter
binary) for various architecture information.
<P>
Returns a tuple <code>(bits, linkage)</code> which contain information about
the bit architecture and the linkage format used for the
executable. Both values are returned as strings.
<P>
Values that cannot be determined are returned as given by the
parameter presets. If bits is given as <code>''</code>, the
<tt class="cfunction">sizeof(pointer)</tt>
(or <tt class="cfunction">sizeof(long)</tt> on Python version &lt; 1.5.2) is used as
indicator for the supported pointer size.
<P>
The function relies on the system's <span class="file">file</span> command to do the
actual work. This is available on most if not all <span class="Unix">Unix</span>
platforms and some non-<span class="Unix">Unix</span> platforms and then only if the
executable points to the Python interpreter. Reasonable defaults
are used when the above needs are not met.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2568' xml:id='l2h-2568' class="function">machine</tt></b>(</nobr></td>
<td><var></var>)</td></tr></table></dt>
<dd>
Returns the machine type, e.g. <code>'i386'</code>.
An empty string is returned if the value cannot be determined.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2569' xml:id='l2h-2569' class="function">node</tt></b>(</nobr></td>
<td><var></var>)</td></tr></table></dt>
<dd>
Returns the computer's network name (may not be fully qualified!).
An empty string is returned if the value cannot be determined.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2570' xml:id='l2h-2570' class="function">platform</tt></b>(</nobr></td>
<td><var>aliased=0, terse=0</var>)</td></tr></table></dt>
<dd>
Returns a single string identifying the underlying platform
with as much useful information as possible.
<P>
The output is intended to be <em>human readable</em> rather than
machine parseable. It may look different on different platforms and
this is intended.
<P>
If <var>aliased</var> is true, the function will use aliases for various
platforms that report system names which differ from their common
names, for example SunOS will be reported as Solaris. The
<tt class="function">system_alias()</tt> function is used to implement this.
<P>
Setting <var>terse</var> to true causes the function to return only the
absolute minimum information needed to identify the platform.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2571' xml:id='l2h-2571' class="function">processor</tt></b>(</nobr></td>
<td><var></var>)</td></tr></table></dt>
<dd>
Returns the (real) processor name, e.g. <code>'amdk6'</code>.
<P>
An empty string is returned if the value cannot be determined. Note
that many platforms do not provide this information or simply return
the same value as for <tt class="function">machine()</tt>. NetBSD does this.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2572' xml:id='l2h-2572' class="function">python_build</tt></b>(</nobr></td>
<td><var></var>)</td></tr></table></dt>
<dd>
Returns a tuple <code>(<var>buildno</var>, <var>builddate</var>)</code> stating the
Python build number and date as strings.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2573' xml:id='l2h-2573' class="function">python_compiler</tt></b>(</nobr></td>
<td><var></var>)</td></tr></table></dt>
<dd>
Returns a string identifying the compiler used for compiling Python.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2574' xml:id='l2h-2574' class="function">python_version</tt></b>(</nobr></td>
<td><var></var>)</td></tr></table></dt>
<dd>
Returns the Python version as string <code>'major.minor.patchlevel'</code>
<P>
Note that unlike the Python <code>sys.version</code>, the returned value
will always include the patchlevel (it defaults to 0).
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2575' xml:id='l2h-2575' class="function">python_version_tuple</tt></b>(</nobr></td>
<td><var></var>)</td></tr></table></dt>
<dd>
Returns the Python version as tuple <code>(<var>major</var>, <var>minor</var>,
<var>patchlevel</var>)</code> of strings.
<P>
Note that unlike the Python <code>sys.version</code>, the returned value
will always include the patchlevel (it defaults to <code>'0'</code>).
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2576' xml:id='l2h-2576' class="function">release</tt></b>(</nobr></td>
<td><var></var>)</td></tr></table></dt>
<dd>
Returns the system's release, e.g. <code>'2.2.0'</code> or <code>'NT'</code>
An empty string is returned if the value cannot be determined.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2577' xml:id='l2h-2577' class="function">system</tt></b>(</nobr></td>
<td><var></var>)</td></tr></table></dt>
<dd>
Returns the system/OS name, e.g. <code>'Linux'</code>, <code>'Windows'</code>,
or <code>'Java'</code>.
An empty string is returned if the value cannot be determined.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2578' xml:id='l2h-2578' class="function">system_alias</tt></b>(</nobr></td>
<td><var>system, release, version</var>)</td></tr></table></dt>
<dd>
Returns <code>(<var>system</var>, <var>release</var>, <var>version</var>)</code> aliased
to common marketing names used for some systems. It also does some
reordering of the information in some cases where it would otherwise
cause confusion.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2579' xml:id='l2h-2579' class="function">version</tt></b>(</nobr></td>
<td><var></var>)</td></tr></table></dt>
<dd>
Returns the system's release version, e.g. <code>'#3 on degas'</code>.
An empty string is returned if the value cannot be determined.
</dl>
<P>
<dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline">
<td><nobr><b><tt id='l2h-2580' xml:id='l2h-2580' class="function">uname</tt></b>(</nobr></td>
<td><var></var>)</td></tr></table></dt>
<dd>
Fairly portable uname interface. Returns a tuple of strings
<code>(<var>system</var>, <var>node</var>, <var>release</var>, <var>version</var>,
<var>machine</var>, <var>processor</var>)</code> identifying the underlying
platform.
<P>
Note that unlike the <tt class="function">os.uname()</tt> function this also returns
possible processor information as additional tuple entry.
<P>
Entries which cannot be determined are set to <code>''</code>.
</dl>
<P>
<DIV CLASS="navigation">
<div class='online-navigation'>
<p></p><hr />
<table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td class='online-navigation'><a rel="prev" title="6.30 platform "
href="module-platform.html"><img src='../icons/previous.png'
border='0' height='32' alt='Previous Page' width='32' /></A></td>
<td class='online-navigation'><a rel="parent" title="6.30 platform "
href="module-platform.html"><img src='../icons/up.png'
border='0' height='32' alt='Up One Level' width='32' /></A></td>
<td class='online-navigation'><a rel="next" title="6.30.2 Java Platform"
href="node366.html"><img src='../icons/next.png'
border='0' height='32' alt='Next Page' width='32' /></A></td>
<td align="center" width="100%">Python Library Reference</td>
<td class='online-navigation'><a rel="contents" title="Table of Contents"
href="contents.html"><img src='../icons/contents.png'
border='0' height='32' alt='Contents' width='32' /></A></td>
<td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png'
border='0' height='32' alt='Module Index' width='32' /></a></td>
<td class='online-navigation'><a rel="index" title="Index"
href="genindex.html"><img src='../icons/index.png'
border='0' height='32' alt='Index' width='32' /></A></td>
</tr></table>
<div class='online-navigation'>
<b class="navlabel">Previous:</b>
<a class="sectref" rel="prev" href="module-platform.html">6.30 platform </A>
<b class="navlabel">Up:</b>
<a class="sectref" rel="parent" href="module-platform.html">6.30 platform </A>
<b class="navlabel">Next:</b>
<a class="sectref" rel="next" href="node366.html">6.30.2 Java Platform</A>
</div>
</div>
<hr />
<span class="release-info">Release 2.4.2, documentation updated on 28 September 2005.</span>
</DIV>
<!--End of Navigation Panel-->
<ADDRESS>
See <i><a href="about.html">About this document...</a></i> for information on suggesting changes.
</ADDRESS>
</BODY>
</HTML>