Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 981
Sophie Avatar asked Feb 05 '14 04:02

Sophie


People also ask

How do I run a command-line argument 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.

Which command will redirect Who output and?

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.

Which command will redirect to output to the file?

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.


1 Answers

(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

like image 99
yossico Avatar answered Oct 13 '22 09:10

yossico