pythonchallenge第六关

来源:互联网 发布:易语言卡盟登陆器源码 编辑:程序博客网 时间:2024/04/27 18:36

学习了一下python中zipfile模块,先把网址html换为zip,可以得到一个压缩文件

根据提示,不断寻找,直到找到最终的我文件,提示 collect the comments

修改程序,把途中的每个文件的comment都添加到一个string中


代码如下:

import zipfile
import re
import time


z = zipfile.ZipFile('channel.zip','r')
num = '90052'
comments = ''
while(True):
    filename = num
    print("filename",filename)
    filename += '.txt'
    print(filename)
    content = z.read(filename)
    print(content)
    numstr = re.search(r'([0-9])+',content)
    if numstr:
       print(numstr.group())
       num = numstr.group()
       print(z.getinfo(filename).comment)
       comments += z.getinfo(filename).comment
    else:
       break
print(comments)


得到hockey,进入后提示看每个字母的组成字母, 得到oxygen即到下一关

原创粉丝点击