On 12/11/2024 08:52, Loris Bennett via Python-list wrote:
Cameron Simpson<[email protected]> 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