从 Python 2.7更新到3.7版本后,原来执行正常的脚本报错:AttributeError: module ‘urllib’ has no attribute ‘urlencode’的错误。
原来Python3.7的urllib结构不太一样,要写成:urllib.parse.urlencode
- 本文固定链接: http://jingyan.idoubi.net/818.html
- 转载请注明: 游戏创作者大陆 于 逗分享开发经验 发表
从 Python 2.7更新到3.7版本后,原来执行正常的脚本报错:AttributeError: module ‘urllib’ has no attribute ‘urlencode’的错误。
原来Python3.7的urllib结构不太一样,要写成:urllib.parse.urlencode