- 论坛徽章:
- 0
|
本帖最后由 jjwspj 于 2012-08-27 19:37 编辑
我用http.client.HTTPConnection()在python下报错“AttributeError: 'module' object has no attribute 'client'”,但ipython正常,请高人指点,感谢!- bill131:~ # python3
- Python 3.2.2 (default, May 6 2012, 16:18:48)
- [GCC 4.3.4 [gcc-4_3-branch revision 152973]] on linux2
- Type "help", "copyright", "credits" or "license" for more information.
- >>> import http
- >>> web_url="www.baidu.com"
- >>> http.client.HTTPConnection(web_url)
- Traceback (most recent call last):
- File "<stdin>", line 1, in <module>
- AttributeError: 'module' object has no attribute 'client'
- >>>
复制代码- In [1]: import http
- In [2]: web_url="www.baidu.com"
- In [3]: http.client.HTTPConnection(web_url)
- Out[3]: <http.client.HTTPConnection at 0x10d8510>
- In [4]:
复制代码 |
|