我遇到以下错误:
C:\Users\DELL>C:\Users\DELL\AppData\Local\Programs\Python\Python37\python.exe D:\Arduino\ckAnimation_generator.py
File "D:\Arduino\ckAnimation_generator.py", line 19
bloodySettingsPath ="C:\\Program Files (x86)\\KeyDominator2\\KeyDominator2\\UserLog\\Keyboard\\B857Rcir_2178872A\\English\\Setting\\SLED\NumberPadAtRight\\Setting.ini"
^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 115-116: malformed \N character escape
答案 0 :(得分:0)
要么转义REVERSE SOLIDUS(反斜杠)字符,要么将字符串指定为raw。
bloodySettingsPath = "C:\\Program Files (x86)\\KeyDominator2\\KeyDominator2\\UserLog\\Keyboard\\B857Rcir_2178872A\\English\\Setting\\SLED\\NumberPadAtRight\\Setting.ini"
或
bloodySettingsPath = r"C:\Program Files (x86)\KeyDominator2\KeyDominator2\UserLog\Keyboard\B857Rcir_2178872A\English\Setting\SLED\NumberPadAtRight\Setting.ini"