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?
To run PyCharm from the shell, use the open command with the following options: -a : specify the application. --args : specify additional arguments when passing more than just the file or directory to open.
The > symbol is used to redirect output by taking the output from the command on the left and passing as input to the file on the right.
To redirect the output of a command to a file, type the command, specify the > or the >> operator, and then provide the path to a file you want to the output redirected to. For example, the ls command lists the files and folders in the current directory.
(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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With