python2.x文件编码

#这几种文件编码的方式,python2都支持。
#utf-8,utf8都行,大小写没关系。
#一定要放在文件的开头的第一行或第二行

# encoding=utf8
# encoding=utf-8
# -*- coding: utf-8 -*-
# -*- coding: utf8 -*-
# encoding:utf8
# encoding:utf-8
# -*- coding=utf-8 -*-
# -*- coding=utf8 -*-

#不写则默认编码是ascii,Python3 则默认 UTF-8 了

posted @ 2013-02-06 14:29  独孤侠  阅读(139)  评论(0编辑  收藏  举报