justdo-it  

在pycharm中的python文件中输入中文会报错SyntaxError:

问题解决方法在文件开头添加 :

# -*- coding:utf-8 -*-

每次添加都很麻烦,一劳永逸解决此问题的方法:
file-->setting-->editor-->File and Code Templates-->Python Script 添加:

#oding = utf-8
# -*- coding:utf-8 -*-

点击OK

posted on 2016-03-06 20:17  justdo-it  阅读(2636)  评论(0)    收藏  举报