Input redirection with IDLE

Discussion in 'Python' started by candide, Oct 13, 2009.

  1. candide

    candide Guest

    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 ?
    candide, Oct 13, 2009
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. MadHatter

    input redirection

    MadHatter, Oct 14, 2003, in forum: Perl
    Replies:
    6
    Views:
    688
    MadHatter
    Oct 16, 2003
  2. S
    Replies:
    1
    Views:
    811
  3. Dan Upton

    fork/exec with input redirection

    Dan Upton, Nov 26, 2007, in forum: Python
    Replies:
    3
    Views:
    400
    Dan Upton
    Nov 27, 2007
  4. Some Friend
    Replies:
    2
    Views:
    312
    Some Friend
    Jan 9, 2012
  5. Michal Suchanek

    Input redirection in ruby

    Michal Suchanek, Jul 31, 2008, in forum: Ruby
    Replies:
    4
    Views:
    124
    Robert Klemme
    Aug 1, 2008
Loading...

Share This Page