Anonymous (owner)

Forks

Revisions

  • f1b719 Mon Jun 22 20:02:00 -0700 2009
gist: 134329 Download_button fork
public
Public Clone URL: git://gist.github.com/134329.git
Embed All Files: show embed
Python #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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()