PythonChallenge Mission 6

打开第六关,看到了一个拉链图片,联想到zip,打开源代码第一行果然有注释内容zip

于是把网页地址替换为http://www.pythonchallenge.com/pc/def/zip.html,然后就可以看到如下提示:

yes. find the zip.

原来是要找一个压缩文件啊,窝不断地尝试终于发现http://www.pythonchallenge.com/pc/def/channel.zip是下载地址

下载后打开channel.zip压缩文件,查看readme.txt,发现:

welcome to my zipped list. hint1: start from 90052 hint2: answer is inside the zip

原来是像之前网址链接一样遍历,只不过这次迭代对象变成了文件,提示告诉我们从90052开始,答案在zip文件里(有深意。。。)

将文件解压,然后遍历:

import os
path1=os.path.abspath('.')+"\channel\\"
init=str(90052);
while 1:
    file1=file(path1+init+".txt").read()
    print file1
    init=file1.split(' ')[-1]
得到结果:

Collect the comments.不明觉厉啊,求助度娘后发现zip文件有comment属性,原来题目是要我们把comment收集起来,于是乎:

import zipfile
value=90052
comments=[]
z =zipfile.ZipFile("channel.zip")
while True:
    try:
        content=z.read('%s.txt'%value)
        print z.getinfo('%s.txt'%value).comment
        comments.append(z.getinfo('%s.txt'%value).comment)
        value=content.split(' ')[-1]
        print content
    except Exception,e:
        print e
        break
print ''.join(comments)
发现打印输出:



于是把网址替换为http://www.pythonchallenge.com/pc/def/hockey.html,告诉我们要look at the letters

原来网址是组成哪些字母图片的字母本身。。。

将网址替换为http://www.pythonchallenge.com/pc/def/oxygen.html成功进入下一关!

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值