摘要: #coding:utf-8 import os import sys #当前环境py2.7 print(sys.getdefaultencoding()) #注意是编码方式,不是编码 #定义一个字符串 str = '中' #print(str) print(len(str)) #长度3, utf-8 #str.encode('gbk') #报错,当前编码环境为ascii 不能直接从ascii映射... 阅读全文
posted @ 2018-01-05 11:05 我是外婆 阅读(421) 评论(0) 推荐(0) 编辑