The reason is that in the simplified Chinese environment of the Win7 system, the Chinese encoding format used by default is the GBK format, and Eclipse's default encoding format is the encoding format of the system in which it is used. Therefore, you need to modify eclipse in the default encoding format.
Steps Open Eclipse,windows-Preferences ...
Navigate to General, Workspace on the left, click Other in the text file encoding on the right, select UTF-8, and click OK.
Step 2 Windows-Preferences ...
Navigate to content Types on the left, click Text in the content Types on the right, select Python File, enter UTF-8 in the default encoding below, and click Update. then click OK.
After modifying the default encoding format for Eclipse workspaces and Python files, in a Python module with Chinese encoding, the first line of the file declares the encoding format of the file, #-*-Coding:utf-8-*-can be developed and debugged with the Chinese Python program.
Python in Eclipse Chinese error resolution SYNTAXERROR:NON-ASCII character