Re: Assignment of global variables in a script.

2025-06-30 Thread Thomas Passin
On 6/30/2025 11:53 PM, Popov, Dmitry Yu via Python-list wrote: Dear Sirs. I found the following sentence in the Python documentation: "The statements executed by the top-level invocation of the interpreter, either read from a script file or interactively, are considered part of a module called

Assignment of global variables in a script.

2025-06-30 Thread Popov, Dmitry Yu via Python-list
Dear Sirs. I found the following sentence in the Python documentation: "The statements executed by the top-level invocation of the interpreter, either read from a script file or interactively, are considered part of a module called __main__

configparser get non-existent boolean

2025-06-30 Thread Rob Cliffe via Python-list
I was surprised to find that in configparser, getboolean() does not raise KeyError for a non-existent config parameter. Demo program (Python 3.11.5, Windows 11): import configparser config = configparser.ConfigParser() config.read('ThisFileDoesNotExist.ini') # This line could be removed MY_BOOL