https://betapython.com/how-to-redirect-stdout-to-a-file-in-python/
How to Redirect stdout To A File In Python?