Re: Best use of "open" context manager

Liste des GroupesRevenir à cl python 
Sujet : Re: Best use of "open" context manager
De : cs (at) *nospam* cskk.id.au (Cameron Simpson)
Groupes : comp.lang.python
Date : 08. Jul 2024, 04:45:21
Autres entêtes
Message-ID : <mailman.19.1720406738.2981.python-list@python.org>
References : 1 2
User-Agent : Mutt/2.2.13 (2024-03-09)
On 07Jul2024 22:22, Rob Cliffe <rob.cliffe@btinternet.com> wrote:
it's legal, but doesn't work (trying to access the file after "with f" raises the same
    ValueError: I/O operation on closed file.
Just to this: of course. The with closes the file. But my version runs the with after the try/except.

Date Sujet#  Auteur
8 Jul 24 o Re: Best use of "open" context manager1Cameron Simpson

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal