python使得文件不包含重复行
set函数去重
SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。# -*- coding:utf-8 -*- srcTxt=open('1.txt','r').readlines() noRepeat=open('2.txt','w') st=set(srcTxt) noRepeat.write(''.join(st))

更多精彩
set函数去重
SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。# -*- coding:utf-8 -*- srcTxt=open('1.txt','r').readlines() noRepeat=open('2.txt','w') st=set(srcTxt) noRepeat.write(''.join(st))