| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
| 2 | <html> |
| 3 | <head> |
| 4 | <link rel="STYLESHEET" href="lib.css" type='text/css' /> |
| 5 | <link rel="SHORTCUT ICON" href="../icons/pyfav.png" type="image/png" /> |
| 6 | <link rel='start' href='../index.html' title='Python Documentation Index' /> |
| 7 | <link rel="first" href="lib.html" title='Python Library Reference' /> |
| 8 | <link rel='contents' href='contents.html' title="Contents" /> |
| 9 | <link rel='index' href='genindex.html' title='Index' /> |
| 10 | <link rel='last' href='about.html' title='About this document...' /> |
| 11 | <link rel='help' href='about.html' title='About this document...' /> |
| 12 | <link rel="next" href="os-miscfunc.html" /> |
| 13 | <link rel="prev" href="os-process.html" /> |
| 14 | <link rel="parent" href="module-os.html" /> |
| 15 | <link rel="next" href="os-miscfunc.html" /> |
| 16 | <meta name='aesop' content='information' /> |
| 17 | <title>6.1.6 Miscellaneous System Information </title> |
| 18 | </head> |
| 19 | <body> |
| 20 | <DIV CLASS="navigation"> |
| 21 | <div id='top-navigation-panel' xml:id='top-navigation-panel'> |
| 22 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> |
| 23 | <tr> |
| 24 | <td class='online-navigation'><a rel="prev" title="6.1.5 Process Management" |
| 25 | href="os-process.html"><img src='../icons/previous.png' |
| 26 | border='0' height='32' alt='Previous Page' width='32' /></A></td> |
| 27 | <td class='online-navigation'><a rel="parent" title="6.1 os " |
| 28 | href="module-os.html"><img src='../icons/up.png' |
| 29 | border='0' height='32' alt='Up One Level' width='32' /></A></td> |
| 30 | <td class='online-navigation'><a rel="next" title="6.1.7 Miscellaneous Functions" |
| 31 | href="os-miscfunc.html"><img src='../icons/next.png' |
| 32 | border='0' height='32' alt='Next Page' width='32' /></A></td> |
| 33 | <td align="center" width="100%">Python Library Reference</td> |
| 34 | <td class='online-navigation'><a rel="contents" title="Table of Contents" |
| 35 | href="contents.html"><img src='../icons/contents.png' |
| 36 | border='0' height='32' alt='Contents' width='32' /></A></td> |
| 37 | <td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png' |
| 38 | border='0' height='32' alt='Module Index' width='32' /></a></td> |
| 39 | <td class='online-navigation'><a rel="index" title="Index" |
| 40 | href="genindex.html"><img src='../icons/index.png' |
| 41 | border='0' height='32' alt='Index' width='32' /></A></td> |
| 42 | </tr></table> |
| 43 | <div class='online-navigation'> |
| 44 | <b class="navlabel">Previous:</b> |
| 45 | <a class="sectref" rel="prev" href="os-process.html">6.1.5 Process Management</A> |
| 46 | <b class="navlabel">Up:</b> |
| 47 | <a class="sectref" rel="parent" href="module-os.html">6.1 os </A> |
| 48 | <b class="navlabel">Next:</b> |
| 49 | <a class="sectref" rel="next" href="os-miscfunc.html">6.1.7 Miscellaneous Functions</A> |
| 50 | </div> |
| 51 | <hr /></div> |
| 52 | </DIV> |
| 53 | <!--End of Navigation Panel--> |
| 54 | |
| 55 | <H2><A NAME="SECTION008160000000000000000"></A><A NAME="os-path"></A> |
| 56 | <BR> |
| 57 | 6.1.6 Miscellaneous System Information |
| 58 | </H2> |
| 59 | |
| 60 | <P> |
| 61 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 62 | <td><nobr><b><tt id='l2h-1718' xml:id='l2h-1718' class="function">confstr</tt></b>(</nobr></td> |
| 63 | <td><var>name</var>)</td></tr></table></dt> |
| 64 | <dd> |
| 65 | Return string-valued system configuration values. |
| 66 | <var>name</var> specifies the configuration value to retrieve; it may be a |
| 67 | string which is the name of a defined system value; these names are |
| 68 | specified in a number of standards (POSIX, <span class="Unix">Unix</span> 95, <span class="Unix">Unix</span> 98, and |
| 69 | others). Some platforms define additional names as well. The names |
| 70 | known to the host operating system are given in the |
| 71 | <code>confstr_names</code> dictionary. For configuration variables not |
| 72 | included in that mapping, passing an integer for <var>name</var> is also |
| 73 | accepted. |
| 74 | Availability: Macintosh, <span class="Unix">Unix</span>. |
| 75 | |
| 76 | <P> |
| 77 | If the configuration value specified by <var>name</var> isn't defined, the |
| 78 | empty string is returned. |
| 79 | |
| 80 | <P> |
| 81 | If <var>name</var> is a string and is not known, <tt class="exception">ValueError</tt> is |
| 82 | raised. If a specific value for <var>name</var> is not supported by the |
| 83 | host system, even if it is included in <code>confstr_names</code>, an |
| 84 | <tt class="exception">OSError</tt> is raised with <tt class="constant">errno.EINVAL</tt> for the |
| 85 | error number. |
| 86 | </dl> |
| 87 | |
| 88 | <P> |
| 89 | <dl><dt><b><tt id='l2h-1719' xml:id='l2h-1719'>confstr_names</tt></b></dt> |
| 90 | <dd> |
| 91 | Dictionary mapping names accepted by <tt class="function">confstr()</tt> to the |
| 92 | integer values defined for those names by the host operating system. |
| 93 | This can be used to determine the set of names known to the system. |
| 94 | Availability: Macintosh, <span class="Unix">Unix</span>. |
| 95 | </dd></dl> |
| 96 | |
| 97 | <P> |
| 98 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 99 | <td><nobr><b><tt id='l2h-1720' xml:id='l2h-1720' class="function">getloadavg</tt></b>(</nobr></td> |
| 100 | <td><var></var>)</td></tr></table></dt> |
| 101 | <dd> |
| 102 | Return the number of processes in the system run queue averaged over |
| 103 | the last 1, 5, and 15 minutes or raises OSError if the load average |
| 104 | was unobtainable. |
| 105 | |
| 106 | <P> |
| 107 | |
| 108 | <span class="versionnote">New in version 2.3.</span> |
| 109 | |
| 110 | </dl> |
| 111 | |
| 112 | <P> |
| 113 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 114 | <td><nobr><b><tt id='l2h-1721' xml:id='l2h-1721' class="function">sysconf</tt></b>(</nobr></td> |
| 115 | <td><var>name</var>)</td></tr></table></dt> |
| 116 | <dd> |
| 117 | Return integer-valued system configuration values. |
| 118 | If the configuration value specified by <var>name</var> isn't defined, |
| 119 | <code>-1</code> is returned. The comments regarding the <var>name</var> |
| 120 | parameter for <tt class="function">confstr()</tt> apply here as well; the dictionary |
| 121 | that provides information on the known names is given by |
| 122 | <code>sysconf_names</code>. |
| 123 | Availability: Macintosh, <span class="Unix">Unix</span>. |
| 124 | </dl> |
| 125 | |
| 126 | <P> |
| 127 | <dl><dt><b><tt id='l2h-1722' xml:id='l2h-1722'>sysconf_names</tt></b></dt> |
| 128 | <dd> |
| 129 | Dictionary mapping names accepted by <tt class="function">sysconf()</tt> to the |
| 130 | integer values defined for those names by the host operating system. |
| 131 | This can be used to determine the set of names known to the system. |
| 132 | Availability: Macintosh, <span class="Unix">Unix</span>. |
| 133 | </dd></dl> |
| 134 | |
| 135 | <P> |
| 136 | The follow data values are used to support path manipulation |
| 137 | operations. These are defined for all platforms. |
| 138 | |
| 139 | <P> |
| 140 | Higher-level operations on pathnames are defined in the |
| 141 | <tt class="module"><a href="module-os.path.html">os.path</a></tt> module. |
| 142 | |
| 143 | <P> |
| 144 | <dl><dt><b><tt id='l2h-1723' xml:id='l2h-1723'>curdir</tt></b></dt> |
| 145 | <dd> |
| 146 | The constant string used by the operating system to refer to the current |
| 147 | directory. |
| 148 | For example: <code>'.'</code> for POSIX or <code>':'</code> for Mac OS 9. |
| 149 | Also available via <tt class="module">os.path</tt>. |
| 150 | </dd></dl> |
| 151 | |
| 152 | <P> |
| 153 | <dl><dt><b><tt id='l2h-1724' xml:id='l2h-1724'>pardir</tt></b></dt> |
| 154 | <dd> |
| 155 | The constant string used by the operating system to refer to the parent |
| 156 | directory. |
| 157 | For example: <code>'..'</code> for POSIX or <code>'::'</code> for Mac OS 9. |
| 158 | Also available via <tt class="module">os.path</tt>. |
| 159 | </dd></dl> |
| 160 | |
| 161 | <P> |
| 162 | <dl><dt><b><tt id='l2h-1725' xml:id='l2h-1725'>sep</tt></b></dt> |
| 163 | <dd> |
| 164 | The character used by the operating system to separate pathname components, |
| 165 | for example, "<tt class="character">/</tt>" for POSIX or "<tt class="character">:</tt>" for |
| 166 | Mac OS 9. Note that knowing this is not sufficient to be able to |
| 167 | parse or concatenate pathnames -- use <tt class="function">os.path.split()</tt> and |
| 168 | <tt class="function">os.path.join()</tt> -- but it is occasionally useful. |
| 169 | Also available via <tt class="module">os.path</tt>. |
| 170 | </dd></dl> |
| 171 | |
| 172 | <P> |
| 173 | <dl><dt><b><tt id='l2h-1726' xml:id='l2h-1726'>altsep</tt></b></dt> |
| 174 | <dd> |
| 175 | An alternative character used by the operating system to separate pathname |
| 176 | components, or <code>None</code> if only one separator character exists. This is |
| 177 | set to "<tt class="character">/</tt>" on Windows systems where <code>sep</code> is a |
| 178 | backslash. |
| 179 | Also available via <tt class="module">os.path</tt>. |
| 180 | </dd></dl> |
| 181 | |
| 182 | <P> |
| 183 | <dl><dt><b><tt id='l2h-1727' xml:id='l2h-1727'>extsep</tt></b></dt> |
| 184 | <dd> |
| 185 | The character which separates the base filename from the extension; |
| 186 | for example, the "<tt class="character">.</tt>" in <span class="file">os.py</span>. |
| 187 | Also available via <tt class="module">os.path</tt>. |
| 188 | |
| 189 | <span class="versionnote">New in version 2.2.</span> |
| 190 | |
| 191 | </dd></dl> |
| 192 | |
| 193 | <P> |
| 194 | <dl><dt><b><tt id='l2h-1728' xml:id='l2h-1728'>pathsep</tt></b></dt> |
| 195 | <dd> |
| 196 | The character conventionally used by the operating system to separate |
| 197 | search path components (as in <a class="envvar" id='l2h-1732' xml:id='l2h-1732'>PATH</a>), such as "<tt class="character">:</tt>" for |
| 198 | POSIX or "<tt class="character">;</tt>" for Windows. |
| 199 | Also available via <tt class="module">os.path</tt>. |
| 200 | </dd></dl> |
| 201 | |
| 202 | <P> |
| 203 | <dl><dt><b><tt id='l2h-1729' xml:id='l2h-1729'>defpath</tt></b></dt> |
| 204 | <dd> |
| 205 | The default search path used by <tt class="function">exec*p*()</tt> and |
| 206 | <tt class="function">spawn*p*()</tt> if the environment doesn't have a <code>'PATH'</code> |
| 207 | key. |
| 208 | Also available via <tt class="module">os.path</tt>. |
| 209 | </dd></dl> |
| 210 | |
| 211 | <P> |
| 212 | <dl><dt><b><tt id='l2h-1730' xml:id='l2h-1730'>linesep</tt></b></dt> |
| 213 | <dd> |
| 214 | The string used to separate (or, rather, terminate) lines on the |
| 215 | current platform. This may be a single character, such as <code>'\ |
| 216 | n'</code> for POSIX or <code>'\r'</code> for Mac OS, or multiple characters, |
| 217 | for example, <code>'\r\n'</code> for Windows. |
| 218 | </dd></dl> |
| 219 | |
| 220 | <P> |
| 221 | <dl><dt><b><tt id='l2h-1731' xml:id='l2h-1731'>devnull</tt></b></dt> |
| 222 | <dd> |
| 223 | The file path of the null device. |
| 224 | For example: <code>'/dev/null'</code> for POSIX or <code>'Dev:Nul'</code> for |
| 225 | Mac OS 9. |
| 226 | Also available via <tt class="module">os.path</tt>. |
| 227 | |
| 228 | <span class="versionnote">New in version 2.4.</span> |
| 229 | |
| 230 | </dd></dl> |
| 231 | |
| 232 | <P> |
| 233 | |
| 234 | <DIV CLASS="navigation"> |
| 235 | <div class='online-navigation'> |
| 236 | <p></p><hr /> |
| 237 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> |
| 238 | <tr> |
| 239 | <td class='online-navigation'><a rel="prev" title="6.1.5 Process Management" |
| 240 | href="os-process.html"><img src='../icons/previous.png' |
| 241 | border='0' height='32' alt='Previous Page' width='32' /></A></td> |
| 242 | <td class='online-navigation'><a rel="parent" title="6.1 os " |
| 243 | href="module-os.html"><img src='../icons/up.png' |
| 244 | border='0' height='32' alt='Up One Level' width='32' /></A></td> |
| 245 | <td class='online-navigation'><a rel="next" title="6.1.7 Miscellaneous Functions" |
| 246 | href="os-miscfunc.html"><img src='../icons/next.png' |
| 247 | border='0' height='32' alt='Next Page' width='32' /></A></td> |
| 248 | <td align="center" width="100%">Python Library Reference</td> |
| 249 | <td class='online-navigation'><a rel="contents" title="Table of Contents" |
| 250 | href="contents.html"><img src='../icons/contents.png' |
| 251 | border='0' height='32' alt='Contents' width='32' /></A></td> |
| 252 | <td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png' |
| 253 | border='0' height='32' alt='Module Index' width='32' /></a></td> |
| 254 | <td class='online-navigation'><a rel="index" title="Index" |
| 255 | href="genindex.html"><img src='../icons/index.png' |
| 256 | border='0' height='32' alt='Index' width='32' /></A></td> |
| 257 | </tr></table> |
| 258 | <div class='online-navigation'> |
| 259 | <b class="navlabel">Previous:</b> |
| 260 | <a class="sectref" rel="prev" href="os-process.html">6.1.5 Process Management</A> |
| 261 | <b class="navlabel">Up:</b> |
| 262 | <a class="sectref" rel="parent" href="module-os.html">6.1 os </A> |
| 263 | <b class="navlabel">Next:</b> |
| 264 | <a class="sectref" rel="next" href="os-miscfunc.html">6.1.7 Miscellaneous Functions</A> |
| 265 | </div> |
| 266 | </div> |
| 267 | <hr /> |
| 268 | <span class="release-info">Release 2.4.2, documentation updated on 28 September 2005.</span> |
| 269 | </DIV> |
| 270 | <!--End of Navigation Panel--> |
| 271 | <ADDRESS> |
| 272 | See <i><a href="about.html">About this document...</a></i> for information on suggesting changes. |
| 273 | </ADDRESS> |
| 274 | </BODY> |
| 275 | </HTML> |