摘要: 1、字典转换为字符串,写入json文件(json.dumps) 1 #json.dumps 字典-->字符串 2 d={'name':'xiaohei','cars':[1,2,3,4],'houst':(4,5,6),'addr':"北京"} #字典 3 with open("a.txt", "w 阅读全文
posted @ 2019-09-25 09:45 遇见最好的你_juan 阅读(468) 评论(0) 推荐(0) 编辑
摘要: import osgeci=open("a.txt",encoding="utf-8")new_geci=open("a1.txt","w",encoding="utf-8")for line in geci: change=line.replace("一","1") new_geci.write( 阅读全文
posted @ 2019-09-25 09:23 遇见最好的你_juan 阅读(510) 评论(0) 推荐(0) 编辑
摘要: import timea=0while True: d={} f = open(r"/Users/**juan/Downloads/access.log",encoding="utf-8") f.seek(a) for line in f: if line.split() !="": f1=line 阅读全文
posted @ 2019-09-25 09:11 遇见最好的你_juan 阅读(263) 评论(0) 推荐(0) 编辑