后浪云Python教程:Python输出不了中文怎么解决

在文件头加上#encoding:utf-8即可。
相关推荐:《Python教程》
# encoding: utf-8
print 'helloworld'
print u"学习"
print (unicode("学习", encoding="utf-8"))shell输出:
helloworld 学习 学习
还可以用#-*- coding: UTF-8 -*- 来指定。
版权声明:
作者:后浪云
链接:https://idc.net/help/168770/
文章版权归作者所有,未经允许请勿转载。
THE END
