-
-
Save jjgod/134333 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try: | |
inf2 = open(fname, "r") | |
for line in inf2: | |
cols = line.split() | |
#print line | |
if(len(cols)>=3): | |
if(cols[2]=="1"): continue | |
url = cols[0] | |
#print "original url = "+url | |
url = url.replace(".", "/") | |
if url[-1]=="/": url=url[:-1] | |
urlparts = url.split("/") | |
partsno =len(urlparts) | |
#prepare each pars for re operation | |
... | |
inf2.close() | |
except IOError: | |
print "The file does not exist, goto the next file" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment