Skip to content

Instantly share code, notes, and snippets.

@siddartha
Created March 19, 2014 15:48
Show Gist options
  • Save siddartha/9644601 to your computer and use it in GitHub Desktop.
Save siddartha/9644601 to your computer and use it in GitHub Desktop.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
set1 = open('set1.txt','r')
set2 = open('set2.txt','r')
output = open('diff.txt','w')
eachhost1 = set1.read().splitlines()
#print eachhost1
eachhost2 = set2.read().splitlines()
#print eachhost2
for host2 in eachhost2:
if host2 in eachhost1:
print "Matched with: "+host2
else:
domain = "domain:"+host2+"\n"
output.write(domain)
set1.close()
set2.close()
output.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment