爬取猫眼电影top100中,with open('result.txt', 'a', encoding='utf-8') as f:这段代码为什么会报错TypeError: 'encoding' is an invalid keyword argument for this function,有哪位大神知道吗?

0
已邀请:
0

ID王大伟 - 人生苦短,我选Python。 2018-01-03 回答

把encoding='utf-8'这个参数去掉试试
0

_缘君_ - 半缘兴趣半缘君 2018-01-13 回答

python2没有encoding参数,除非使用的open函数为io.open()

要回复问题请先登录注册