美文网首页
python3 导入 from urllib import ur

python3 导入 from urllib import ur

作者: Al_不期而遇 | 来源:发表于2018-06-19 16:29 被阅读1次

在python3的版本中导入

from urllib import urlencode

出现如下错误

cannot import name 'urlencode'

这是因为from urllib import urlencode是python2的导入方式

python3导入方式from urllib.parse import urlencode

相关文章

网友评论

      本文标题:python3 导入 from urllib import ur

      本文链接:https://www.haomeiwen.com/subject/czaaeftx.html