pip install contexts python from contexts import suppress, redirect_stdout python with suppress(FileNotFoundError): file = open('nonexistent.txt', 'r') python with open('output.txt', 'w') as f, redirect_stdout(f):