我使用的FileInput讀一些大的數據:使用fileinput.input()讀取的gzip文件
import gzip
import fileinput
f=gzip.open('/scratch/try.fastq.gz','r')
for line in fileinput.input(f):
print line
但是我得到了像錯誤:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/share/lib/python2.6/fileinput.py", line 253, in next
line = self.readline()
File "/share/lib/python2.6/fileinput.py", line 345, in readline
self._file = open(self._filename, self._mode)
IOError: [Errno 2] No such file or directory: '@HWI-ST150_0129:2:1:13466:2247#0/1\n'
無法承擔的FileInput文件對象輸入?那麼如何使用fileinput來處理gzip文件? thx
其實這並沒有真正的工作.. – user815408
這是我的另一篇文章:http://stackoverflow.com/questions/8454344/fileinput-usage-with-openbook-hook-compressed – user815408