Python gzip
来源:互联网 发布:准提法网络佛学院官网 编辑:程序博客网 时间:2024/06/03 03:34
frompymongo import MongoClient
importsys
importStringIO
importgzip
replset= MongoClient(sys.argv[1],replicaset=sys.argv[2])
coll= replset[sys.argv[3]].call_info_tab
compressedFile= StringIO.StringIO()
forrec in coll.find({'insertTime':long(sys.argv[4])}):
if rec.get('data'):
compressedFile.write(rec.get('data'))
compressedFile.seek(0)
decompressedFile= gzip.GzipFile(fileobj=compressedFile, mode= 'rb')
with open(sys.argv[5],'w') asoutfile:
content= decompressedFile.read()
for linein content.split(sys.argv[6]):
outfile.write(line+'\n');
outfile.close()
0 0
- Python gzip
- python gzip
- python gzip
- Zlib gzip 解压缩
- 5.6 文件压缩 gzip 和bipz2
- python gzip压缩文件
- python gzip模块
- Python mechanize gzip response handling
- python抓取时gzip解压
- python 多线程+gzip压缩 爬虫
- python的gzip库使用方法
- 用Python创建gzip压缩文件
- Python gzip模块基准测试
- python的gzip库使用方法
- Python之gzip文件读写
- [python][库]gzip库使用方法
- gzip
- gzip
- 记个公式
- c++ 关于char *的…
- 时间转化
- Cmder 中文乱码设置
- Cmder alais 设置
- Python gzip
- Zlib gzip 解压缩
- gooreplacer 解决国外网站加…
- 加密算法的理解
- windows vim 粘贴
- Effective C++笔记
- Python tuples list
- Python 类型转化
- Google 编程规范1.2