我想在我的一个脚本中使用urllib.parse.urlencode()方法。 进口的urllib蟒蛇3.2错误说urllib.parse.urlencode()没有定义
#!/usr/bin/python3.2
import urllib
data = urllib.parse.urlencode({'type': 'device_code','client_id': 150792241632891})
它以前工作,但现在我得到以下错误。
输出
Traceback (most recent call last):
File "/home/rakesh/programming/test.py", line 8, in <module>
data = urllib.parse.urlencode({'type': 'device_code','client_id': 150792241632891})
AttributeError: 'module' object has no attribute 'parse'
最初,我怀疑我的Python外壳,但是当我检查了它的使用Python 3.2版本应该是fiine。
现在我完全困惑了python shell为什么会这样做。 我在这里错过了什么吗?
感谢
@larsmans用于响应。 – Rakesh 2012-04-22 14:58:23