import io | |
import sys | |
def read_file(path, data): | |
with io.open(path) as file: | |
for domain in file.readlines(): | |
data.add(domain.strip().lower()) | |
def write_file(data, path='whitelist.txt'): | |
with io.open(path, 'w') as file: | |
file.write('\n'.join(sorted(data))) | |
if __name__ == '__main__': | |
domains = set() | |
for path in sys.argv[1:]: | |
read_file(path, domains) | |
write_file(domains) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment