python设置中文编码 熟悉python的同志们都知道在python中注释的语句是# 但是如果在开头写上# -*- coding: UTF-8 -*-这句注释, 那么这个.py文件就被设置成中文编码。