python学习之编码

来源:互联网 发布:知名玄幻网络作家 编辑:程序博客网 时间:2024/06/02 00:42

在python2中如果要输出中文或注释有中文必须在开头加上,#coding=utf-8

python3默认编码是utf-8

#!/user/bin/python#coding=utf-8#alt+shift+F10 运行  alt+shift+F9 调试  Ctrl + /   行注释/取消行注释  print "hello world"  print ("hello world")  print "你好"