file pointer array

FSH lee.joosang at gmail.com
Mon Jun 4 21:21:20 EDT 2012


Hello,

I have a simple question. I wish to generate an array of file
pointers. For example, I have files:

data1.txt
data2.txt
data3.txt
....

I wish to generate fine pointer array so that I can read the files at
the same time.

for index in range(N):
     fid[index] = open('data%d.txt' % index,'r')

I look forward to your advice for this problem.

-FSH



More information about the Python-list mailing list