摘要: GBK转换UTF-8: 方法两种: 1.使用unicode转换。(py3内存中所有字符串都是unicode,unicode是万国码)。注释:py2不行,py2内存中ascii码。 GBK ->解码decode('GBK') ->编码encode('utf-8') 2.转换成UTF-8 阅读全文
posted @ 2020-05-06 22:50 安好_世界 阅读(190) 评论(0) 推荐(0) 编辑
摘要: import sys,time'''#文件句柄f = open("yesterday2",'a',encoding="utf-8")#'r'=read,'w'=write,w是创建文件.a=append追加的意思.默认读模式# print(f.read())#文件光标读取一遍f.write("我爱北 阅读全文
posted @ 2020-05-06 20:59 安好_世界 阅读(135) 评论(0) 推荐(0) 编辑