Input redirection with IDLE

candide candide at free.invalid
Tue Oct 13 10:16:16 EDT 2009


Hi

Does  IDLE (the default GUI avalaible with the standard distribution)
support redirection from the standard input ? To be more precise, inside
a Windows or Linux shell I may redirect input data from a text file to
be executed by a python file. For instance suppose I have this python file


# foo.py
print int(raw_input())+int(raw_input())


and this data file

--------- data.txt BOF ------------
42
77
--------- data.txt EOF ------------

I may process the data in this way :

~$ python foo.py < data.txt

and the result is the following printing  :

119


Is IDLE able to provide the same service ?




More information about the Python-list mailing list