在pycharm下寫的.
報錯訊息如下:
C:\Python27\python.exe "C:\Program Files\JetBrains\PyCharm 2017.1.2\helpers\pydev\pydevd.py" --multiproc --qt-support --client 127.0.0.1 --port 51755 --file E:/python/first.py
pydev debugger: process 4988 is connecting
Connected to pydev debugger (build 171.4249.47)
Traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm 2017.1.2\helpers\pydev\pydevd.py", line 1585, in <module>
globals = debugger.run(setup['file'], None, None, is_module)
File "C:\Program Files\JetBrains\PyCharm 2017.1.2\helpers\pydev\pydevd.py", line 1015, in run
pydev_imports.execfile(file, globals, locals) # execute the script
File "E:/python/first.py", line 3
SyntaxError: Non-ASCII character '\xe7' in file E:/python/first.py on line 3, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
Process finished with exit code 1
後來自己回憶了一下,是我大意了..記得第一次debug的時候,
#是要修改下圖圈內的檔案路徑的,當我修改完檔案路徑之後,程式可以運行了.
所以每次創建新程式debug的時候,都要手動在這裡修改檔案路徑嗎?
代碼中用了中文逗號,換成英文格式就好。提示裡有指出。