在文件头加上#encoding:utf-8即可。
相关推荐:《Python教程》
#encoding:utf-8 print'helloworld' printu"学习" print(unicode("学习",encoding="utf-8"))
shell输出:
helloworld 学习 学习
还可以用#-*- coding: UTF-8 -*- 来指定。
上一篇
python中OpenCV调节亮度
下一篇
python中hash算法是否可逆
四叶天代理IP,专业代理IP厂家,主营动态、静态、长效、短效、住宅IP。