Thursday 15 March 2012

python - How come i need to make another file handle to read the same file again? -


I was playing around the file with Python, so I wrote it:

   

prints the second loop file, if I do not handle the second file. Why is this?
Should not it work without another one?

That's because the first loop ends, the current ifh At that point at the end of the status file, read and do not have data.

To read data again, you need to use to return to the beginning of the file.

No comments:

Post a Comment