Hello,
I have this code :
import urllib
import zipfile
import re
totaal = 0
commentaar = []
lus = True
image = urllib.URLopener()
image.retrieve("http://www.pythonchallenge.com/pc/def/channel.zip","channel.zip" )
bestand = "readme.txt"
zf = zipfile.ZipFile('channel.zip')
while lus == True :
for filename in [ bestand ]:
try:
data = zf.read(filename)
except KeyError:
print 'ERROR: Did not find %s in zip file' % filename
else:
print filename, ':'
data = repr(data)
print data
comments = zf.infolist()
for test in comments:
commentaar.append(test.comment)
print
nummer = re.search('\d{2,}', data)
try:
bestand = str(nummer.group())+".txt"
print bestand
except:
lus = False
print commentaar
This should make a word.
But I see a lot of rubbisch.
Can anyone explain me what I done wrong here ?
Roelof