s3=set() #s3=set(open(‘/home/work/ctt/20150409.uid.head‘,‘r‘).readlines()) file=open(‘/home/work/ctt/20150409.uid.head‘) for line in file.readlines(): line=line.strip(‘\n‘) # print line s3.add(line) print s3
s3.add(line) 而不是s3=set(line)
时间: 2024-10-12 07:57:34