Put following codes in sitecustomize.py and put this file in your PYTHONPATH, which means it can be imported. This file may already exists somewhere in your PYTHONPATH, if so, just append the following codes in it. The file sitecustomize.py is a special file which is automatically imported when python restarts.
# sitecustomize.py # this file can be anywhere in your Python path import sys sys.setdefaultencoding('utf-8')
No comments:
Post a Comment