file pointer array

Jon Clements joncle at googlemail.com
Wed Jun 6 14:28:53 EDT 2012


On 06/06/12 18:54, Prasad, Ramit wrote:
> data= []
> for index in range(N, 1): # see Chris Rebert's comment
>      with open('data%d.txt' % index,'r') as f:
>          data.append( f.readlines() )
>

I think "data.extend(f)" would be a better choice.

Jon.




More information about the Python-list mailing list