报错:TypeError: 'float' object cannot be interpreted as an integer
emmm,原来是符号打错了,打扰了。。。
报错:UnicodeEncodeError: 'gbk' codec can't encode character '\x80' in position 33: illegal multibyte sequence
这个报错好像可以忽略。还是有结果输出。。。如果不想看到报错的话,可以在open的里加
errors='ignore'
其他解决方案:
源代码:with open (os.path.join(self.root,filename),mode=‘w’,newline=’’) as f:
其他: 在open()里面加入 encoding=‘utf-8’ 【未尝试成功,仅做记录】
-------------------------------------------------------------------------2020年12月前↓
1)忘记在 if , elif , else , for , while , class ,def 声明末尾添加 :(导致 “SyntaxError :i