擅长:python、mysql、java
<p>看<a href="http://svn.python.org/view/python/trunk/Lib/os.py?annotate=77218" rel="noreferrer">os.py</a>,第55-67行:</p>
<pre><code>elif 'nt' in _names:
name = 'nt'
linesep = '\r\n'
from nt import *
try:
from nt import _exit
except ImportError:
pass
import ntpath as path
import nt
__all__.extend(_get_exports_list(nt))
del nt
</code></pre>
<p><code>import ntpath as path</code>是导致<code>os.path</code>在您的平台(毫无疑问是Windows)上成为<code>ntpath</code>的特定语句。</p>