Python 出现”ValueError: invalid literal for int() with base 10: \xef\xbb\xbf0″ 错误

运行.py程序时,提示错误:”ValueError: invalid literal for int() with base 10: \xef\xbb\xbf0″ ,如下图所示,

经检查,主要是因为文件的按UTF-8格式打开,导致int类型转换错误,重新将文件格式改为 UTF-8无BOM格式 编码后可打开。

10 0

  • 注释 ( Comments )

  ( 如果您发现有错误,欢迎批评指正。邮箱 . 如果您喜欢这篇博文,请在上面给我 点个赞 吧! :-)   :-)   

  ( If you found any mistakes in the post, please let me know. Email : If you like this posts, please give me a thumbs up rating on the above button! )

  • 微信公众号 ( Wechat Subscription)


欢迎关注 “结构之旅” 微信公众号

Leave a Reply

Your email address will not be published. Required fields are marked *

:wink: :-| :-x :twisted: :) 8-O :( :roll: :-P :oops: :-o :mrgreen: :lol: :idea: :-D :evil: :cry: 8) :arrow: :-? :?: :!:

This site uses Akismet to reduce spam. Learn how your comment data is processed.