def download(self, url, savepath="/tmp/"): """Copy the contents of a file from a given URL to a local file.""" webfile = urllib.urlopen(url) localfile = open( os.path.join(savepath, url.split('/')[-1]), 'w') localfile.write(webfile.read()) webfile.close() localfile.close()