Can someone tell me how Python "aliases" os.path
to ntpath
?
>>> import os.path
>>> os.path
<module 'ntpath' from 'C:\Python26\lib\ntpath.pyc'>
>>>
Can someone tell me how Python "aliases" os.path
to ntpath
?
>>> import os.path
>>> os.path
<module 'ntpath' from 'C:\Python26\lib\ntpath.pyc'>
>>>
Look at os.py, lines 55-67:
The
import ntpath as path
is the specific statement that causesos.path
to bentpath
on your platforms (doubtlessly Windows).EDIT: And since
import
is a simple statement in Python, you can do neat stuff like: