Ich habe 2010 begonnen mich etwas mit Python zu beschäftigen. Die Website hier finde ich gut, allerdings ausbaufähig.
Download von Dateien aus dem Netz:
1 import urllib.request
2
3 def DateiDownload(url):
4
5 dateiname = url.rsplit('/',1)
6 dateiname = str(dateiname[1])
7
8 try:
9 webfile = urllib.request.urlopen(url, 'rb')
10 f = open(dateiname, 'wb')
11 a = webfile.read()
12 f.write(a)
13 webfile.close()
14 f.close()
15 except: # urllib.error.HTTPError
16 print ('Fehler.')
17
18 url = 'http://docs.python.org/py3k/_static/py.png'
19
20 DateiDownload(url)