Memory error due to the huge/huge input file size

John Machin sjmachin at lexicon.net
Tue Nov 11 00:14:55 CET 2008


On Nov 11, 8:47 am, tejsu... at gmail.com wrote:

> import linecache

Why???

> reader2 = csv.reader(open(sys.argv[2],"rb"))
> reader2_list = []
> reader2_list.extend(reader2)
>
> for data2 in reader2_list:
>    refSeqIDsinTransPro.append(data2[3])
> for data2 in reader2_list:
>    promoterSequencesinTransPro.append(data2[4])


All you need to do is replace the above by:

reader2 = csv.reader(open(sys.argv[2],"rb"))

for data2 in reader2:
   refSeqIDsinTransPro.append(data2[3])
   promoterSequencesinTransPro.append(data2[4])



More information about the Python-list mailing list