Zip应用
时间:2010-02-02 来源:angelia_liu
Level 6
ZIP document: http://docs.python.org/library/zipfile.html图片中有一条牛仔裤(拉链的英文名为:zipper)。
Title提示为pair.
源码中有〈!-- 〈-- zip --〉字样。
从http://www.pythonchallenge.com/pc/def/channel.zip 下载zip文件
解压这个ZIP文件,里面有一个readme文件提示:
welcome to my zipped list.
hint1: start from 90052
hint2: answer is inside the zip
从这里可以看出跟Level 4差不多,就是反复从文件中提取下一文件的文件名。
import os |
执行后显示:
collect the comments
这个comments 就在ZIP文件里面,ZIP有一个对像叫ZipFile.comment。
ZipFile.commentThe comment text associated with the ZIP file. If assigning a comment to a ZipFile instance created with mode ‘a’ or ‘w’, this should be a string no longer than 65535 bytes. Comments longer than this will be truncated in the written archive when ZipFile.close() is called.
import sys |
也可以利用代码从网站上下载ZIP文件:
from StringIO import StringIO |