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格式 编码后可打开。


You already voted!

  • 微信公众号 ( Wechat Subscription)

WeChat_QRCode

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

Leave a Reply

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

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