“Unicode Error ”unicodeescape\" codec can't decode bytes… Cannot open text files in Python 3
- 阅读更多 关于 “Unicode Error ”unicodeescape\" codec can't decode bytes… Cannot open text files in Python 3
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: I am using python 3.1, on a windows 7 machines. Russian is the default system language, and utf-8 is the default encoding. Looking at the answer to a previous question , I have attempting using the "codecs" module to give me a little luck. Here's a few examples: >>> g = codecs . open ( "C:\Users\Eric\Desktop\beeline.txt" , "r" , encoding = "utf-8" ) SyntaxError : ( unicode error ) 'unicodeescape' codec can 't decode bytes in position 2-4: truncated \UXXXXXXXX escape ( , line 1) >>> g = codecs.open("C:\Users\Eric\Desktop\Site.txt",