Python – reset stdout to normal, after previously redirecting it to a file December 12, 2023 by Tarik The original stdout can be accessed as sys.__stdout__. This is documented.