摘要: Tips: Windows操作系统中文版系统的字符编码为GBK。 linux操作系统默认的是utf-8编码 打印系统默认编码: 在python2默认编码是ASCII; “In Python 3, all strings are sequences of Unicode characters. ”—— 阅读全文
posted @ 2017-06-21 17:02 Zoe233 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 转载:http://www.cnblogs.com/yuanchenqi/articles/5956943.html 一、 什么是编码? 基本概念很简单。首先,我们从一段信息即消息说起,消息以人类可以理解、易懂的表示存在。我打算将这种表示称为“明文”(plain text)。对于说英语的人,纸张上打 阅读全文
posted @ 2017-06-21 16:42 Zoe233 阅读(945) 评论(0) 推荐(0) 编辑
摘要: 1 import sys 2 3 f=open('lyrics.txt','r',encoding='utf-8') #读写 4 f_new=open('lyrics_new','w+',encoding='utf-8') 5 find_str=sys.argv[1] 6 replace_str=sys.argv[2] 7 for line in f: 8 if fi... 阅读全文
posted @ 2017-06-21 15:55 Zoe233 阅读(388) 评论(0) 推荐(0) 编辑