Re: Using 'with open(...) as ...' (Posting On Python-List Prohibited)

Liste des GroupesRevenir à cl python 
Sujet : Re: Using 'with open(...) as ...' (Posting On Python-List Prohibited)
De : ldo (at) *nospam* nz.invalid (Lawrence D'Oliveiro)
Groupes : comp.lang.python
Date : 30. Oct 2024, 02:10:14
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vfrth6$1p8n1$3@dont-email.me>
References : 1
User-Agent : Pan/0.160 (Toresk; )
On Tue, 29 Oct 2024 14:56:01 +0100, Loris Bennett wrote:

    with open(args.config_file, 'r') as config_file:

I never bother with putting files into context managers. This is not a
good idea for files open for writing, but even for read-only files (as
here), CPython will close the file when the object goes out of scope
anyway.

Date Sujet#  Auteur
29 Oct 24 * Using 'with open(...) as ...' together with configparser.ConfigParser.read12Loris Bennett
29 Oct 24 +* Re: Using 'with open(...) as ...' together with configparser.ConfigParser.read9Jon Ribbens
30 Oct 24 i`* Re: Using 'with open(...) as ...' together with configparser.ConfigParser.read8Loris Bennett
30 Oct 24 i `* Re: Using 'with open(...) as ...' together with configparser.ConfigParser.read7Jon Ribbens
30 Oct 24 i  `* Re: Using 'with open(...) as ...' together with configparser.ConfigParser.read6Loris Bennett
30 Oct 24 i   `* Re: Using 'with open(...) as ...' together with configparser.ConfigParser.read5Jon Ribbens
31 Oct 24 i    `* Re: Using 'with open(...) as ...' together with configparser.ConfigParser.read4Loris Bennett
31 Oct 24 i     +- Re: Using 'with open(...) as ...' together with configparser.ConfigParser.read1Jon Ribbens
31 Oct 24 i     +- Re: Using 'with open(...) as ...' together with configparser.ConfigParser.read1Karsten Hilbert
31 Oct 24 i     `- Re: Using 'with open(...) as ...' together with configparser.ConfigParser.read1MRAB
29 Oct 24 +- Re: Using 'with open(...) as ...' together with configparser.ConfigParser.read1MRAB
30 Oct 24 `- Re: Using 'with open(...) as ...' (Posting On Python-List Prohibited)1Lawrence D'Oliveiro

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal