Ok, Can someone point me in the right direction, I'm trying to run the python code, the below is where I'm at. I think I've defined the variables correctly? I get an error 'test' is not defined, how do I correctly assign file name variable? I'm not after the full solution just a friendly pointer in the right direction. Thanks
#!/usr/bin/python import io import urllib import sys file_name = "test" link = "http://talk.maemo.org/showthread.php?t=73315" start_page = 1 end_page = 255 def get_thread(file_name, link, start_page, end_page): for num in range(int(start_page), int(end_page) + 1): #print "grabbing page " + str(num) page = urllib.urlopen("%s&page=%d" % (link, num)).read() with io.open("%s-page%d.html" % (file_name, num) , 'w') as file: file.write(unicode(page, 'utf-8')) file.close() if __name__ == '__main__': sys.exit(get_thread(sys.argv[1], sys.argv[2], sys.argv[3], sys.argv[4]))