loial wrote:
> If I read a file using a for loop, as follows, is the file left open if I
> execute a break in the for loop?
>
>
> for line in open(myFile).readlines():
>
> if something:
> break
Whether the file is left open has nothing to do with how you leave the loop.
The way yo
On Fri, Sep 5, 2014 at 8:20 PM, loial wrote:
> If I read a file using a for loop, as follows, is the file left open if I
> execute a break in the for loop?
>
>
> for line in open(myFile).readlines():
>
> if something:
> break
It'll be closed when the object expires. With CPython, tha
If I read a file using a for loop, as follows, is the file left open if I
execute a break in the for loop?
for line in open(myFile).readlines():
if something:
break
--
https://mail.python.org/mailman/listinfo/python-list