Chinaunix首页 | 论坛 | 博客
  • 博客访问: 179918
  • 博文数量: 69
  • 博客积分: 1430
  • 博客等级: 上尉
  • 技术积分: 686
  • 用 户 组: 普通用户
  • 注册时间: 2008-06-22 11:12
文章存档

2011年(1)

2010年(11)

2009年(35)

2008年(22)

我的朋友

分类: LINUX

2010-03-08 17:32:48

即使你看到下面这段代码,你还是不一定能得到答案,作者的目的也许就达到了。

#!/usr/bin/python
import zipfile,os

zipFile = zipfile.ZipFile('./channel.zip')
zipFile.extractall('channel')


file_name = './channel/90052.txt'
comments=''
file_prefix = './channel/'
while True:
    try:
        fp = open(file_name,'r')
        file_name_tmp=fp.read().split('Next nothing is ',1)[-1]+'.txt'
        file_name=file_prefix+file_name_tmp
        comments +=zipFile.getinfo(file_name_tmp).comment
    except:
        print comments

print zipFile.comment
zipFile.close()


阅读(1074) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~