1.在py文件中使用中文字符
unicode.py文件内容如下所示:
# -*- coding:utf-8 -*- str_ch = '我们women' uni_ch = u'我们women' print "type:", type(str_ch), "content:", str_ch, repr(str_ch) print "type:", type(uni_ch), "content:", uni_ch, repr(uni_ch) # -*
unicode.py文件内容如下所示:
# -*- coding:utf-8 -*- str_ch = '我们women' uni_ch = u'我们women' print "type:", type(str_ch), "content:", str_ch, repr(str_ch) print "type:", type(uni_ch), "content:", uni_ch, repr(uni_ch) # -*