S
Shu-Hsien Sheu
Hi,
Does the seek method would close the file object after using a for loop?
My program looks like this:
f = open('somefile', 'r')
for lines in f:
some operations
f.seek(0)
for lines in f:
other operations
Python gave me an IOErros saying that the file object is already closed.
I am now opening the file again under another file object.
Am I doing something wrong or it's a bug?
Thanks!
-shuhsien
Does the seek method would close the file object after using a for loop?
My program looks like this:
f = open('somefile', 'r')
for lines in f:
some operations
f.seek(0)
for lines in f:
other operations
Python gave me an IOErros saying that the file object is already closed.
I am now opening the file again under another file object.
Am I doing something wrong or it's a bug?
Thanks!
-shuhsien