<!DOCTYPE html PUBLIC
"-//W3C//DTD HTML 4.0 Transitional//EN">
<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=
"os-miscfunc.html" />
<link rel=
"prev" href=
"os-process.html" />
<link rel=
"parent" href=
"module-os.html" />
<link rel=
"next" href=
"os-miscfunc.html" />
<meta name='aesop' content='information'
/>
<title>6.1.6 Miscellaneous System Information
</title>
<div id='top-navigation-panel' xml:id='top-navigation-panel'
>
<table align=
"center" width=
"100%" cellpadding=
"0" cellspacing=
"2">
<td class='online-navigation'
><a rel=
"prev" title=
"6.1.5 Process Management"
href=
"os-process.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.1 os "
href=
"module-os.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.1.7 Miscellaneous Functions"
href=
"os-miscfunc.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>
<div class='online-navigation'
>
<b class=
"navlabel">Previous:
</b>
<a class=
"sectref" rel=
"prev" href=
"os-process.html">6.1.5 Process Management
</A>
<b class=
"navlabel">Up:
</b>
<a class=
"sectref" rel=
"parent" href=
"module-os.html">6.1 os
</A>
<b class=
"navlabel">Next:
</b>
<a class=
"sectref" rel=
"next" href=
"os-miscfunc.html">6.1.7 Miscellaneous Functions
</A>
<!--End of Navigation Panel-->
<H2><A NAME=
"SECTION008160000000000000000"></A><A NAME=
"os-path"></A>
6.1.6 Miscellaneous System Information
<dl><dt><table cellpadding=
"0" cellspacing=
"0"><tr valign=
"baseline">
<td><nobr><b><tt id='l2h-
1718' xml:id='l2h-
1718'
class=
"function">confstr
</tt></b>(
</nobr></td>
<td><var>name
</var>)
</td></tr></table></dt>
Return string-valued system configuration values.
<var>name
</var> specifies the configuration value to retrieve; it may be a
string which is the name of a defined system value; these names are
specified in a number of standards (POSIX,
<span class=
"Unix">Unix
</span> 95,
<span class=
"Unix">Unix
</span> 98, and
others). Some platforms define additional names as well. The names
known to the host operating system are given in the
<code>confstr_names
</code> dictionary. For configuration variables not
included in that mapping, passing an integer for
<var>name
</var> is also
Availability: Macintosh,
<span class=
"Unix">Unix
</span>.
If the configuration value specified by
<var>name
</var> isn't defined, the
empty string is returned.
If
<var>name
</var> is a string and is not known,
<tt class=
"exception">ValueError
</tt> is
raised. If a specific value for
<var>name
</var> is not supported by the
host system, even if it is included in
<code>confstr_names
</code>, an
<tt class=
"exception">OSError
</tt> is raised with
<tt class=
"constant">errno.EINVAL
</tt> for the
<dl><dt><b><tt id='l2h-
1719' xml:id='l2h-
1719'
>confstr_names
</tt></b></dt>
Dictionary mapping names accepted by
<tt class=
"function">confstr()
</tt> to the
integer values defined for those names by the host operating system.
This can be used to determine the set of names known to the system.
Availability: Macintosh,
<span class=
"Unix">Unix
</span>.
<dl><dt><table cellpadding=
"0" cellspacing=
"0"><tr valign=
"baseline">
<td><nobr><b><tt id='l2h-
1720' xml:id='l2h-
1720'
class=
"function">getloadavg
</tt></b>(
</nobr></td>
<td><var></var>)
</td></tr></table></dt>
Return the number of processes in the system run queue averaged over
the last
1,
5, and
15 minutes or raises OSError if the load average
<span class=
"versionnote">New in version
2.3.
</span>
<dl><dt><table cellpadding=
"0" cellspacing=
"0"><tr valign=
"baseline">
<td><nobr><b><tt id='l2h-
1721' xml:id='l2h-
1721'
class=
"function">sysconf
</tt></b>(
</nobr></td>
<td><var>name
</var>)
</td></tr></table></dt>
Return integer-valued system configuration values.
If the configuration value specified by
<var>name
</var> isn't defined,
<code>-
1</code> is returned. The comments regarding the
<var>name
</var>
parameter for
<tt class=
"function">confstr()
</tt> apply here as well; the dictionary
that provides information on the known names is given by
<code>sysconf_names
</code>.
Availability: Macintosh,
<span class=
"Unix">Unix
</span>.
<dl><dt><b><tt id='l2h-
1722' xml:id='l2h-
1722'
>sysconf_names
</tt></b></dt>
Dictionary mapping names accepted by
<tt class=
"function">sysconf()
</tt> to the
integer values defined for those names by the host operating system.
This can be used to determine the set of names known to the system.
Availability: Macintosh,
<span class=
"Unix">Unix
</span>.
The follow data values are used to support path manipulation
operations. These are defined for all platforms.
Higher-level operations on pathnames are defined in the
<tt class=
"module"><a href=
"module-os.path.html">os.path
</a></tt> module.
<dl><dt><b><tt id='l2h-
1723' xml:id='l2h-
1723'
>curdir
</tt></b></dt>
The constant string used by the operating system to refer to the current
For example:
<code>'.'
</code> for POSIX or
<code>':'
</code> for Mac OS
9.
Also available via
<tt class=
"module">os.path
</tt>.
<dl><dt><b><tt id='l2h-
1724' xml:id='l2h-
1724'
>pardir
</tt></b></dt>
The constant string used by the operating system to refer to the parent
For example:
<code>'..'
</code> for POSIX or
<code>'::'
</code> for Mac OS
9.
Also available via
<tt class=
"module">os.path
</tt>.
<dl><dt><b><tt id='l2h-
1725' xml:id='l2h-
1725'
>sep
</tt></b></dt>
The character used by the operating system to separate pathname components,
for example,
"<tt class="character
">/</tt>" for POSIX or
"<tt class="character
">:</tt>" for
Mac OS
9. Note that knowing this is not sufficient to be able to
parse or concatenate pathnames -- use
<tt class=
"function">os.path.split()
</tt> and
<tt class=
"function">os.path.join()
</tt> -- but it is occasionally useful.
Also available via
<tt class=
"module">os.path
</tt>.
<dl><dt><b><tt id='l2h-
1726' xml:id='l2h-
1726'
>altsep
</tt></b></dt>
An alternative character used by the operating system to separate pathname
components, or
<code>None
</code> if only one separator character exists. This is
set to
"<tt class="character
">/</tt>" on Windows systems where
<code>sep
</code> is a
Also available via
<tt class=
"module">os.path
</tt>.
<dl><dt><b><tt id='l2h-
1727' xml:id='l2h-
1727'
>extsep
</tt></b></dt>
The character which separates the base filename from the extension;
for example, the
"<tt class="character
">.</tt>" in
<span class=
"file">os.py
</span>.
Also available via
<tt class=
"module">os.path
</tt>.
<span class=
"versionnote">New in version
2.2.
</span>
<dl><dt><b><tt id='l2h-
1728' xml:id='l2h-
1728'
>pathsep
</tt></b></dt>
The character conventionally used by the operating system to separate
search path components (as in
<a class=
"envvar" id='l2h-
1732' xml:id='l2h-
1732'
>PATH
</a>), such as
"<tt class="character
">:</tt>" for
POSIX or
"<tt class="character
">;</tt>" for Windows.
Also available via
<tt class=
"module">os.path
</tt>.
<dl><dt><b><tt id='l2h-
1729' xml:id='l2h-
1729'
>defpath
</tt></b></dt>
The default search path used by
<tt class=
"function">exec*p*()
</tt> and
<tt class=
"function">spawn*p*()
</tt> if the environment doesn't have a
<code>'PATH'
</code>
Also available via
<tt class=
"module">os.path
</tt>.
<dl><dt><b><tt id='l2h-
1730' xml:id='l2h-
1730'
>linesep
</tt></b></dt>
The string used to separate (or, rather, terminate) lines on the
current platform. This may be a single character, such as
<code>'
\
n'
</code> for POSIX or
<code>'
\r'
</code> for Mac OS, or multiple characters,
for example,
<code>'
\r
\n'
</code> for Windows.
<dl><dt><b><tt id='l2h-
1731' xml:id='l2h-
1731'
>devnull
</tt></b></dt>
The file path of the null device.
For example:
<code>'/dev/null'
</code> for POSIX or
<code>'Dev:Nul'
</code> for
Also available via
<tt class=
"module">os.path
</tt>.
<span class=
"versionnote">New in version
2.4.
</span>
<div class='online-navigation'
>
<table align=
"center" width=
"100%" cellpadding=
"0" cellspacing=
"2">
<td class='online-navigation'
><a rel=
"prev" title=
"6.1.5 Process Management"
href=
"os-process.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.1 os "
href=
"module-os.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.1.7 Miscellaneous Functions"
href=
"os-miscfunc.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>
<div class='online-navigation'
>
<b class=
"navlabel">Previous:
</b>
<a class=
"sectref" rel=
"prev" href=
"os-process.html">6.1.5 Process Management
</A>
<b class=
"navlabel">Up:
</b>
<a class=
"sectref" rel=
"parent" href=
"module-os.html">6.1 os
</A>
<b class=
"navlabel">Next:
</b>
<a class=
"sectref" rel=
"next" href=
"os-miscfunc.html">6.1.7 Miscellaneous Functions
</A>
<span class=
"release-info">Release
2.4.2, documentation updated on
28 September
2005.
</span>
<!--End of Navigation Panel-->
See
<i><a href=
"about.html">About this document...
</a></i> for information on suggesting changes.