Thanks a lot.
that helped me to understand that behaviour.
Best regards.
___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor
ZEMMOURA Khalil Zakaria writes:
> The file opened using open() is closed automaticaly after iterationg
> over it in the python shell
You can interrogate a file to ask whether it is closed; the ‘closed’
attribute will be True when the file is closed.
> testfile = open('test.txt')
> for line in t
ZEMMOURA Khalil Zakaria wrote:
> Hi,
>
> I am playing with python3.6 and i noticed a change in the behaviour of the
> open() builtin function.
>
> The file opened using open() is closed automaticaly after iterationg over
> it in the python shell
>
> Here is the dummy code i am using:
>
> # Beg
Hi,
I am playing with python3.6 and i noticed a change in the behaviour of the
open() builtin function.
The file opened using open() is closed automaticaly after iterationg over it in
the python shell
Here is the dummy code i am using:
# Beggin
testfile = open('test.txt')
for line in testfil