Created
June 23, 2009 03:01
-
-
Save anonymous/134329 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") | |
except IOError: | |
print "The file does not exist, goto the next file" | |
else: | |
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 | |
... | |
finally: | |
inf2.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment