UnicodeDecodeError: 'ascii' codec can't decode解決
今天拷貝了一段在WINDOW正常運行的python代碼到mac上運行,提示
UnicodeDecodeError: 'ascii' codec can't decode
解決方法其實很簡單,添加一下代碼,強制修改格式即可。當然也可以用vim修改格式
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
今天拷貝了一段在WINDOW正常運行的python代碼到mac上運行,提示
UnicodeDecodeError: 'ascii' codec can't decode
解決方法其實很簡單,添加一下代碼,強制修改格式即可。當然也可以用vim修改格式
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。