Added Proper countries to the iplookup

This commit is contained in:
benjamyn committed 2018-03-29 05:38:41 +11:00
1 parent 2af820f565
commit b41fc878fc
5 files changed
+283 -3

No files matched your search

Executable
+23
View File
@@ -0,0 +1,23 @@
#!/usr/bin/python2
## Country Code Lookup Library
## Import the CSV file for the country codes
def openCSV(filename):
try:
CSVFile = open(filename)
return CSVFile
except Exception as e:
print(e)
def parseCSV(inputFile):
codeDict = {}
FileContents = inputFile.read()
SepContents = FileContents.split('\n')
#SepContents = FileContents.split(',')
for entry in SepContents:
testentry = entry.split(',')
if len(testentry) == 2:
codeDict[testentry[1]] = testentry[0]
else:
pass
return codeDict
BIN
View File
Binary file not shown.