$ python3.2
Python 3.2.5 (default, Mar 10 2014, 10:39:23)
[GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.2.79)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import urllib
>>> import urllib.request as urllib_request
>>> urllib.request is urllib_request
True
没有区别:
import urllib
和{但是,表单:
from <module> import <object>
将导入所述模块并将对象返回到当前的命名空间或模块中。在示例:
^{pr2}$注意
urlopen
是一个函数。但也要注意:通过导入}。在
urllib.request.urlopen
还可以导入模块:urllib
和{参见:https://docs.python.org/3.4/tutorial/modules.html
相关问题 更多 >
编程相关推荐