jjgod (owner)

Fork Of

gist: 134329 by anonymous

Revisions

gist: 134333 Download_button fork
public
Public Clone URL: git://gist.github.com/134333.git
Python
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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"