mdsk.net
当前位置:首页 >> python如何实现inDEx()功能,不能使用inDEx(),Fin... >>

python如何实现inDEx()功能,不能使用inDEx(),Fin...

本文实例讲述了Python实现压缩与解压gzip大文件的方法。分享给大家供大家参考,具体如下: #encoding=utf-8 #author: walker #date: 2015-10-26 #summary: 测试gzip压缩/解压文件 import gzip BufSize = 1024*8 def gZipFile(src, dst): fin = o...

# open filefin = open("file01.txt", "r")fout = open("file02.txt", "w")# initcount_AG = 0count_AT = 0count_AC = 0# data linesfor line in fin: dat_in = line.split() if int(dat_in[5])>=3 and float(dat_in[7])>=0.1 : fout.write(line...

# open filefin = open("file01.txt", "r")fout = open("file02.txt", "w")# initcount_AG = 0count_AT = 0count_AC = 0# data linesfor line in fin: dat_in = line.split() if dat_in[3]=="A" and dat_in[4]=="G" : count_AG += 1 if dat_in[3...

#!/usr/bin/env python# coding: utf-8newLine = ""inFile, outFile = 'test.txt', 'result.txt'with open(inFile, 'r') as f1: with open(outFile, 'w') as f2: for n, line in enumerate(f1): if n % 3 == 0 and newLine: f2.write(newLine[:-...

网站首页 | 网站地图
All rights reserved Powered by www.mdsk.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com