Avoid Windows Terminals
I don’t go out on a limb, saying “terminal” in a more appropriate way “DOS hint” that comes with Windows 7 is completely undesirable. This was bad on Windows 95, NT, XP, Vista, and 7. Perhaps they fixed it with Powershell, I don’t know. Nevertheless, this indicates problems that at that time were the reason for the development of the OS in Microsoft.
Output to file instead
Set the environment variable PYTHONIOENCODING , and then redirect the output to a file.
set PYTHONIOENCODING=utf-8 ./myscript.py > output.txt
Then, using Notepad ++ , you can see the UTF-8 version of your output.
Install win-unicode console
win-unicode-console can solve your problems. You have to try it
pip install win-unicode-console
If you are interested in a cross-cutting discussion of the issue of python and the command line, check out Python issue 1602 . Otherwise, just use the win-unicode-console package.
py -m run script.py
Runs it in a script, or you can follow their instructions to add win_unicode_console.enable() to each call by adding it to usercustomize or sitecustomize .
source share