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. Advertisements

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. Weng Tianxiang
    Replies:
    12
    Views:
    2,027
  2. MadHatter

    input redirection

    MadHatter, Oct 14, 2003, in forum: Perl
    Replies:
    6
    Views:
    867
    MadHatter
    Oct 16, 2003
  3. ashutosh
    Replies:
    3
    Views:
    9,239
    Andrew Thompson
    Jun 16, 2005
  4. Guy
    Replies:
    5
    Views:
    3,072
    brucie
    Dec 13, 2003
  5. cjl
    Replies:
    1
    Views:
    10,714
    Michael Winter
    Oct 31, 2005
  6. Dan Upton

    fork/exec with input redirection

    Dan Upton, Nov 26, 2007, in forum: Python
    Replies:
    3
    Views:
    579
    Dan Upton
    Nov 27, 2007
  7. Some Friend
    Replies:
    2
    Views:
    407
    Some Friend
    Jan 9, 2012
  8. Michal Suchanek

    Input redirection in ruby

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