"""Prints usage statistics of patches that have been applied to Plan 9""" import urllib if __name__ == "__main__": ok = False urls = ["http://plan9.bell-labs.com/sources/patch/sorry/", "http://plan9.bell-labs.com/sources/patch/applied/"] for url in urls: s = "" s = url[url.find("patch/")+6:len(s)-1] print s.upper() filehandle = urllib.urlopen(url) res = [] for line in filehandle.readlines(): if line.startswith(""): ok = True elif line.startswith(""): ok = False if ok == True: res.append(line) answers = [] for line in res: line = line[line.find("0")+1:line.find("