Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > de.comp.lang.python > #4653

Re: [Python-de] Frage zum configparser

From "Diez B. Roggisch" <deets@web.de>
Newsgroups de.comp.lang.python
Subject Re: [Python-de] Frage zum configparser
Date 2017-01-18 18:35 +0100
Message-ID <mailman.8.1484761269.9761.python-de@python.org> (permalink)
References <o5o87h$q2s$1@tota-refugium.de> <1F0D3BCC-E81B-4FBB-BF4E-1E8CF70DBF3A@web.de>

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

Hallo,

jemand der Gil mit Nachnamen heisst & Python programmiert - da muss ich ja schon schmunzeln :)

> muß ich die Datei "config.ini" nicht irgendwie wieder schließen?
> in der Doku habe ich nix dazu gefunden.
> Oder geschieht diese nach dem Einlesen automatisch durch
> den configparser?

Das geschieht automatisch, so etwas kannst du auch selbst im Code nachlesen:

 https://github.com/python/cpython/blob/master/Lib/configparser.py#L696 <https://github.com/python/cpython/blob/master/Lib/configparser.py#L696>

Wie du siehst wird ein with-statement benutzt. Damit wird die Datei nur zum einmaligen einlesen geoeffnet.

Diez

Back to de.comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Frage zum configparser Manfred Gil <manfred-gil@t-online.de> - 2017-01-18 17:21 +0000
  Re: [Python-de] Frage zum configparser "Sven R. Kunze" <srkunze@mail.de> - 2017-01-18 18:39 +0100
    Re: [Python-de] Frage zum configparser Manfred Gil <manfred-gil@t-online.de> - 2017-01-18 17:56 +0000
  Re: [Python-de] Frage zum configparser "Diez B. Roggisch" <deets@web.de> - 2017-01-18 18:35 +0100
    Re: [Python-de] Frage zum configparser Manfred Gil <manfred-gil@t-online.de> - 2017-01-18 17:55 +0000
  Re: [Python-de] Frage zum configparser Arnold Krille <arnold@arnoldarts.de> - 2017-01-18 22:45 +0100
    Re: [Python-de] Frage zum configparser Manfred Gil <manfred-gil@t-online.de> - 2017-01-19 17:53 +0000
      Re: [Python-de] Frage zum configparser Arnold Krille <arnold@arnoldarts.de> - 2017-01-19 22:02 +0100
        Re: [Python-de] Frage zum configparser Manfred Gil <manfred-gil@t-online.de> - 2017-01-20 18:57 +0000
          Re: [Python-de] Frage zum configparser "Sven R. Kunze" <srkunze@mail.de> - 2017-01-20 20:32 +0100
            Re: [Python-de] Frage zum configparser Manfred Gil <manfred-gil@t-online.de> - 2017-01-21 15:44 +0000
  Re: [Python-de] Frage zum configparser "Sven R. Kunze" <srkunze@mail.de> - 2017-01-19 15:33 +0100

csiph-web