On 12/11/2024 08:52, Loris Bennett via Python-list wrote:
Cameron Simpson<c...@cskk.id.au> writes:Generally you should put a try/except around the smallest possible piece of code.
That is excellent advice. Best wishes Rob Cliffe
So: config = configparser.ConfigParser() try: config.read(args.config_file) except FileNotFoundError as e: print(f"Error: configuration file {args.config_file} not found: {e}")
-- https://mail.python.org/mailman/listinfo/python-list