How do I redirect input and output with PyCharm like I would on the command line?

Sophie picture Sophie · Feb 5, 2014 · Viewed 21.1k times · Source

With the command line if I am running a python file I can enter:

python filename.py < filename.in > filename.out

Is there a way to mimic this behavior in PyCharm?

Answer

yossico picture yossico · Mar 1, 2016

(added in Pycharm 5)

In the Edit Configurations screen under Logs tab check the option: Save console output to file and provide a FULL PATH to the outputfile. thats it - works like magic

enter image description here