摘要: readDir = '去重文本.txt' writeDir = '新文本.txt' # 结果文件的路径 lines_seen = set() #空集合,集合的特性,去重 outfile=open(writeDir,"w+",encoding='utf-8-sig') f = open(readDir 阅读全文
posted @ 2020-05-17 13:16 JIMfan 阅读(288) 评论(0) 推荐(0) 编辑
摘要: 两个一组分割 处理mac地址,添加中横线 import re mac = '50E549E32ECB' # 方法一 mac1 = '' tmp = list(mac) print(tmp) # ['5', '0', 'E', '5', '4', '9', 'E', '3', '2', 'E', 'C 阅读全文
posted @ 2020-05-17 12:31 JIMfan 阅读(5684) 评论(0) 推荐(0) 编辑