摘要: 1,要求在文件 2.py 第六行插入一句话; 1 #cat /root/python/2.py 2 昨夜雨疏风骤1 3 昨夜雨疏风骤2 4 昨夜雨疏风骤3 5 昨夜雨疏风骤4 6 昨夜雨疏风骤5 7 昨夜雨疏风骤6 8 昨夜雨疏风骤7 1 # vim /root/python/file.py 2 f = open("/root/python/2.py","r") 3 num ... 阅读全文
posted @ 2018-01-15 22:15 lixinliang 阅读(196) 评论(0) 推荐(0) 编辑
摘要: 1 #!coding: utf-8 2 s = "特斯拉" 3 s_to_unicode = s.decode("utf-8") 4 unicode_to_gbk = s_to_unicode.encode("gbk") 5 print s 6 print ("unicode:", s_to_unicode) 7 print ("gbk", unicode_to_gbk) 8 ... 阅读全文
posted @ 2018-01-15 14:46 lixinliang 阅读(416) 评论(0) 推荐(0) 编辑