본문 바로가기

wargame/pythonchallenge.com

http://www.pythonchallenge.com/pc/def/channel.html

import re, zipfile
zip = zipfile.ZipFile("C:\\Users\\sec\\Downloads\\channel.zip")
result = ""
file = "90052"  
result = ""  
while 1:  
    text = zip.read(file+".txt")  
    file = re.findall("Next nothing is (\d+)",text)  
    #read the next file name  
    if file :  
        file = "".join(file)  
        result+=zip.getinfo(file+".txt").comment  
        #collect the comments  
    else :  
        #if contents are not "Next nothing..."  
        print result  
        exit(0)