PyScripter is an open-source Python integrated development environment (IDE) developed using Delphi. PyScripter supports Python2.4, 2.5, 2.6, 2.7, 3.0, and 3.1, and can be switched as needed. PyScripter is an open-source Python integrated development environment (IDE) developed using Delphi. PyScripter supports Python2.4, 2.5, 2.6, 2.7, 3.0, and 3.1, and can be switched as needed.
">
PyScripter looks like a good python ide.
Environment:
PyScripter 2.6.0.0
Python3.4
Problem:
PyScripter has a small Pitfall. after opening the file, Chinese characters become garbled. The new file in PyScripter can display Chinese characters normally, but the Chinese characters are garbled after it is re-opened.
PyScripter Chinese garbled characters:
The reason is that if there is no encoding declaration in the file header, PyScripter will open the file using ANSI by default.
PyScripter default file template does not contain encoding declaration, re-open the file time is not opened in UTF-8, so garbled.
Solution:
1. open the file in another editor, add the declaration and save the statement:
# -*- coding: UTF-8 -*-
2. modify the file template of PyScripter and add the previous line:
# -*- coding: UTF-8 -*-
In this way, this line of code declaration is automatically included every time you create a python code file using PyScripter. Very convenient -_-!
Procedure: Tools → Options → File template → python script → then add the encoding declaration to the template:
# -*- coding: UTF-8 -*-
→ Click Update !!! This step is very important. remember to click Update to save the changes.
All configurations of PyScripter are saved in PyScripter. ini. The path is your user directory/AppData \ Roaming \ PyScripter/PyScripter. ini.
C: \ Users \ Administrator \ AppData \ Roaming \ PyScripter
The above is a detailed description of the python development environment PyScripter Chinese garbled problem solution. For more information, please refer to other related articles in the first PHP community!