⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 os-path.html

📁 一本很好的python的说明书,适合对python感兴趣的人
💻 HTML
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>6.1.6 Miscellaneous System Information </title>
<META NAME="description" CONTENT="6.1.6 Miscellaneous System Information ">
<META NAME="keywords" CONTENT="lib">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="STYLESHEET" href="lib.css" tppabs="http://www.python.org/doc/current/lib/lib.css">
<LINK REL="previous" href="os-process.html" tppabs="http://www.python.org/doc/current/lib/os-process.html">
<LINK REL="up" href="module-os.html" tppabs="http://www.python.org/doc/current/lib/module-os.html">
<LINK REL="next" href="module-os.path.html" tppabs="http://www.python.org/doc/current/lib/module-os.path.html">
</head>
<body>
<DIV CLASS="navigation"><table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td><A href="os-process.html" tppabs="http://www.python.org/doc/current/lib/os-process.html"><img src="previous.gif" tppabs="http://www.python.org/doc/current/icons/previous.gif" border="0" height="32"
  alt="Previous Page" width="32"></A></td>
<td><A href="module-os.html" tppabs="http://www.python.org/doc/current/lib/module-os.html"><img src="up.gif" tppabs="http://www.python.org/doc/current/icons/up.gif" border="0" height="32"
  alt="Up One Level" width="32"></A></td>
<td><A href="module-os.path.html" tppabs="http://www.python.org/doc/current/lib/module-os.path.html"><img src="next.gif" tppabs="http://www.python.org/doc/current/icons/next.gif" border="0" height="32"
  alt="Next Page" width="32"></A></td>
<td align="center" width="100%">Python Library Reference</td>
<td><A href="contents.html" tppabs="http://www.python.org/doc/current/lib/contents.html"><img src="contents.gif" tppabs="http://www.python.org/doc/current/icons/contents.gif" border="0" height="32"
  alt="Contents" width="32"></A></td>
<td><a href="modindex.html" tppabs="http://www.python.org/doc/current/lib/modindex.html" title="Module Index"><img src="modules.gif" tppabs="http://www.python.org/doc/current/icons/modules.gif" border="0" height="32"
  alt="Module Index" width="32"></a></td>
<td><A href="genindex.html" tppabs="http://www.python.org/doc/current/lib/genindex.html"><img src="index.gif" tppabs="http://www.python.org/doc/current/icons/index.gif" border="0" height="32"
  alt="Index" width="32"></A></td>
</tr></table>
<b class="navlabel">Previous:</b> <a class="sectref" href="os-process.html" tppabs="http://www.python.org/doc/current/lib/os-process.html">6.1.5 Process Management</A>
<b class="navlabel">Up:</b> <a class="sectref" href="module-os.html" tppabs="http://www.python.org/doc/current/lib/module-os.html">6.1 os  </A>
<b class="navlabel">Next:</b> <a class="sectref" href="module-os.path.html" tppabs="http://www.python.org/doc/current/lib/module-os.path.html">6.2 os.path  </A>
<br><hr></DIV>
<!--End of Navigation Panel-->

<H2>
<BR>
6.1.6 Miscellaneous System Information 
</H2>

<P>
<dl><dt><b><a name='l2h-1015'><tt class='function'>confstr</tt></a></b> (<var>name</var>)
<dd>
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, Unix95, Unix98, 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
accepted.
Availability: Unix.

<P>
If the configuration value specified by <var>name</var> isn't defined, the
empty string is returned.

<P>
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
error number.
</dl>

<P>
<dl><dt><b><a name='l2h-1016'><tt>confstr_names</tt></a></b>
<dd>
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: Unix.
</dl>

<P>
<dl><dt><b><a name='l2h-1017'><tt class='function'>sysconf</tt></a></b> (<var>name</var>)
<dd>
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: Unix.
</dl>

<P>
<dl><dt><b><a name='l2h-1018'><tt>sysconf_names</tt></a></b>
<dd>
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: Unix.
</dl>

<P>
The follow data values are used to support path manipulation
operations.  These are defined for all platforms.

<P>
Higher-level operations on pathnames are defined in the
<tt class='module'><a href="module-os.path.html" tppabs="http://www.python.org/doc/current/lib/module-os.path.html">os.path</a></tt> module.

<P>
<dl><dt><b><a name='l2h-1019'><tt>curdir</tt></a></b>
<dd>
The constant string used by the OS to refer to the current directory,
e.g. <code>'.'</code> for POSIX or <code>':'</code> for the Macintosh.
</dl>

<P>
<dl><dt><b><a name='l2h-1020'><tt>pardir</tt></a></b>
<dd>
The constant string used by the OS to refer to the parent directory,
e.g. <code>'..'</code> for POSIX or <code>'::'</code> for the Macintosh.
</dl>

<P>
<dl><dt><b><a name='l2h-1021'><tt>sep</tt></a></b>
<dd>
The character used by the OS to separate pathname components,
e.g. "<tt class="character">/</tt>" for POSIX or "<tt class="character">:</tt>" for the Macintosh.
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.
</dl>

<P>
<dl><dt><b><a name='l2h-1022'><tt>altsep</tt></a></b>
<dd>
An alternative character used by the OS to separate pathname components,
or <code>None</code> if only one separator character exists.  This is set to
"<tt class="character">/</tt>" on DOS and Windows systems where <code>sep</code> is a backslash.
</dl>

<P>
<dl><dt><b><a name='l2h-1023'><tt>pathsep</tt></a></b>
<dd>
The character conventionally used by the OS to separate search patch
components (as in <a class="envvar" name='l2h-1026'>$PATH</a>), e.g. "<tt class="character">:</tt>" for POSIX or
"<tt class="character">;</tt>" for DOS and Windows.
</dl>

<P>
<dl><dt><b><a name='l2h-1024'><tt>defpath</tt></a></b>
<dd>
The default search path used by <tt class="function">exec*p*()</tt> if the environment
doesn't have a <code>'PATH'</code> key.
</dl>

<P>
<dl><dt><b><a name='l2h-1025'><tt>linesep</tt></a></b>
<dd>
The string used to separate (or, rather, terminate) lines on the
current platform.  This may be a single character,
e.g. <code>'&#92;n'</code> for POSIX or <code>'&#92;r'</code> for MacOS, or multiple
characters, e.g. <code>'&#92;r&#92;n'</code> for MS-DOS and MS Windows.
</dl>

<DIV CLASS="navigation"><p><hr><table align="center" width="100%" cellpadding="0" cellspacing="2">
<tr>
<td><A href="os-process.html" tppabs="http://www.python.org/doc/current/lib/os-process.html"><img src="previous.gif" tppabs="http://www.python.org/doc/current/icons/previous.gif" border="0" height="32"
  alt="Previous Page" width="32"></A></td>
<td><A href="module-os.html" tppabs="http://www.python.org/doc/current/lib/module-os.html"><img src="up.gif" tppabs="http://www.python.org/doc/current/icons/up.gif" border="0" height="32"
  alt="Up One Level" width="32"></A></td>
<td><A href="module-os.path.html" tppabs="http://www.python.org/doc/current/lib/module-os.path.html"><img src="next.gif" tppabs="http://www.python.org/doc/current/icons/next.gif" border="0" height="32"
  alt="Next Page" width="32"></A></td>
<td align="center" width="100%">Python Library Reference</td>
<td><A href="contents.html" tppabs="http://www.python.org/doc/current/lib/contents.html"><img src="contents.gif" tppabs="http://www.python.org/doc/current/icons/contents.gif" border="0" height="32"
  alt="Contents" width="32"></A></td>
<td><a href="modindex.html" tppabs="http://www.python.org/doc/current/lib/modindex.html" title="Module Index"><img src="modules.gif" tppabs="http://www.python.org/doc/current/icons/modules.gif" border="0" height="32"
  alt="Module Index" width="32"></a></td>
<td><A href="genindex.html" tppabs="http://www.python.org/doc/current/lib/genindex.html"><img src="index.gif" tppabs="http://www.python.org/doc/current/icons/index.gif" border="0" height="32"
  alt="Index" width="32"></A></td>
</tr></table>
<b class="navlabel">Previous:</b> <a class="sectref" href="os-process.html" tppabs="http://www.python.org/doc/current/lib/os-process.html">6.1.5 Process Management</A>
<b class="navlabel">Up:</b> <a class="sectref" href="module-os.html" tppabs="http://www.python.org/doc/current/lib/module-os.html">6.1 os  </A>
<b class="navlabel">Next:</b> <a class="sectref" href="module-os.path.html" tppabs="http://www.python.org/doc/current/lib/module-os.path.html">6.2 os.path  </A>
</DIV>
<!--End of Navigation Panel-->
<ADDRESS>
<hr>See <i><a href="about.html" tppabs="http://www.python.org/doc/current/lib/about.html">About this document...</a></i> for information on suggesting changes.
</ADDRESS>
</BODY>
</HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -