I have a big python script where multiple print statements and warnings (e.g. deprecation warnings) are being printed to the IPython console. For debugging purposes I want to write all print statements and warnings/error to an output file. Is there a way to do this in Spyder?
I have tried in the console (but it won't create an output file in any of my directories):
runfile('pyfile.py',wdir='wdir') > output.txt
I know how to do this in the prompt:
python "directory\pyfile.py"> output.txt 2>&1
But being able to do this in Spyder would be way more convenient. I have conducted an extensive search here on Stack Overflow but none of the answers to previous questions gave me the desired result.