首页 > 其他 > 详细

txt去重

时间:2015-10-05 19:34:25      阅读:219      评论:0      收藏:0      [点我收藏+]
#encoding:utf-8
obuff = []
repeat = 0
path = raw_input(‘please input your path:  ‘)
for ln in open(path):
    if ln in obuff:                  
    	repeat+=1
        continue
    obuff.append(ln)
print "repeat columns is %s"  %repeat
with open(path, ‘w‘) as handle:
    handle.writelines(obuff)


本文出自 “安全” 博客,请务必保留此出处http://wushang.blog.51cto.com/10078847/1700263

txt去重

原文:http://wushang.blog.51cto.com/10078847/1700263

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!