擅长:python、mysql、java
<pre><code>>>> import os as my_aliased_module
>>> my_aliased_module
<module 'os' from 'C:\Program Files\Python 2.6\lib\os.pyc'>
</code></pre>
<p><strong>编辑:</strong>并且由于<code>import</code>在Python中是一个简单的语句,所以您可以做一些简单的事情,比如:</p>
<pre><code>import sys
if sys.platform == 'win32':
import windows_module as my_module
else:
import unix_module as my_module
</code></pre>