python2.x默认不支持中文输出,需要在py的开头添加

#coding: utf-8

 

在pycharm里面,选项,editor,file and code templates,选择python script,改成下面的即可。

#coding: utf-8

def run():
    print("hello")

if __name__ == "__main__":
    run()

 

相关文章: