Prevent stack overflow caused by recursion

This commit is contained in:
Klaus-Uwe Mitterer 2015-05-01 22:25:18 +02:00
parent b3a609fa88
commit 2655022746

7
cah.py
View file

@ -23,9 +23,12 @@ def siteHandler(p = 15):
if "files.explosm.net/comics" in img.get('src'):
fileDownloader("http:" + img.get('src'))
for ne in suppe.find_all("a", class_="next-comic"):
siteHandler(ne.get('href').split('/')[2])
return(ne.get('href'))
if __name__ == "__main__":
siteHandler()
output = "//15"
while not '#' in output:
p = output.split('/')[2]
output = siteHandler(p)
print("KTHXBAI")