Acamy / pet-chain-buyer

百度莱茨狗抢购脚本,采用多线程查询购买,支持调用API识别验证码,Google tesseract-ocr识别验证码以及手动输入验证码三种方式,代码持续优化中
43 stars 17 forks source link

乱码怎么弄 #1

Closed luoo369 closed 6 years ago

luoo369 commented 6 years ago

璇疯緭鍏ラ獙璇佺爜锛bgnx 歍raceback (most recent call last): File "pet_chain.py", line 91, in purchase self.captcha = input('璇疯緭鍏ラ獙璇佺爜锛?) File "", line 1, in NameError: name 'bgnx' is not defined success================================================ success================================================ success================================================ success================================================ 璇疯緭鍏ラ獙璇佺爜锛ebry 歍raceback (most recent call last): File "pet_chain.py", line 91, in purchase self.captcha = input('璇疯緭鍏ラ獙璇佺爜锛?) File "", line 1, in NameError: name 'ebry' is not defined success================================================ 璇疯緭鍏ラ獙璇佺爜锛q7db 歍raceback (most recent call last): File "pet_chain.py", line 91, in purchase self.captcha = input('璇疯緭鍏ラ獙璇佺爜锛?) File "", line 1, in NameError: name 'q7db' is not defined

乱码怎么弄

luoo369 commented 6 years ago

E:\Python36\new\pet-chain-buyer-master>python pet_chain.py Traceback (most recent call last): File "pet_chain.py", line 10, in import ocr File "E:\Python36\new\pet-chain-buyer-master\ocr.py", line 9 SyntaxError: Non-ASCII character '\xe4' in file E:\Python36\new\pet-chain-buyer-master\ocr.py on line 9, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

E:\Python36\new\pet-chain-buyer-master>

Acamy commented 6 years ago

应该是cmd.exe默认中文编码是gbk的原因,而程序代码为utf-8 参考:python 中文乱码出现,不知道是什么原因? - 大头的回答 - 知乎