0

As you may know, if using pyinstaller to package python files, there is an option called no-console, so all error information and print result will not shown on screen. My question is if there is any other solution that can let me write those error information and even print result into a log file? I know we can use try-except in python to catch error, but what if an error I did not catch? I hope there is a way so we can log all stdout and stderr into a file, so we can check it later. Thanks!

Zhang Buzz
  • 8,902
  • 5
  • 34
  • 41
  • 2
    use logging http://techies-world.com/how-to-redirect-stdout-and-stderr-to-a-logger-in-python/ here is an article that should help you – Joran Beasley Feb 18 '20 at 01:57
  • Use the python `logging` module as explained in [this answer](https://stackoverflow.com/a/47325975/7306999). – Xukrao Feb 18 '20 at 02:16

0 Answers0