因为工作需要就快速写了一个小脚本。
strip函数要字符的时候才可以用,数列不行。一直搞忘。
#!/usr/bin/env python # by i3ek4 import re,os ips = [] with open('./dict/ip') as f: ip = f.readlines() for i in ip: x = i.strip() ips.append(x) for i in set(ips): print i
因为工作需要就快速写了一个小脚本。
strip函数要字符的时候才可以用,数列不行。一直搞忘。
#!/usr/bin/env python # by i3ek4 import re,os ips = [] with open('./dict/ip') as f: ip = f.readlines() for i in ip: x = i.strip() ips.append(x) for i in set(ips): print i