Run a python program


How can I run a python script just by typing in console #run < with any document.

I now execute my program with cat input | python being input that document that mentioned them.

I'm using linux with python 2.7.6 [GCC 4.8.2]

asked by Ana Gonzalez 04.10.2016 в 01:13

1 answer


I see two ways to do it:

python <

Or that your script has execution permissions and execute it like this:

./ <

I suggest you check your script, and maybe you could make it handle the input of the file as a parameter in the execution of the same script, and that for example, you throw an error message when you do not pass the name of the file . The idea is that the execution is:

answered by 04.10.2016 / 17:49