help debugging stdin in Komodo, IDLE, or PythonWin

Discussion in 'Python' started by Pete Jereb, Oct 2, 2003.

  1. Pete Jereb

    Pete Jereb Guest

    I am really stuck here. I would love to use an IDE to debug my
    programs, but they are all set to accept input from stdin, ie

    python rdip.py < scriptfile.txt


    I can't figure out how to do this in PythonWin, IDLE, or Komodo.
    Help! I've been poring through manuals and google for hours trying to
    figure this out.
    Pete Jereb, Oct 2, 2003
    #1
    1. Advertising

  2. Pete Jereb

    Nick Vargish Guest

    (Pete Jereb) writes:

    > I am really stuck here. I would love to use an IDE to debug my
    > programs, but they are all set to accept input from stdin, ie
    > python rdip.py < scriptfile.txt


    Okay, this doesn't actually solve your problem, but it's a
    work-around.

    sys.stdin = file('scriptfile.txt', 'r')

    Comment that line out when you aren't running under the IDE. It's a
    cheap hack, but at least you only need to add one line...

    Nick

    --
    # sigmask || 0.2 || 20030107 || public domain || feed this to a python
    print reduce(lambda x,y:x+chr(ord(y)-1),' Ojdl!Wbshjti!=obwAcboefstobudi/psh?')
    Nick Vargish, Oct 2, 2003
    #2
    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. stephan
    Replies:
    0
    Views:
    425
    stephan
    Jul 30, 2003
  2. Thomas Lindgaard

    Komodo, debugging and multi-threading

    Thomas Lindgaard, Aug 9, 2004, in forum: Python
    Replies:
    2
    Views:
    315
    Thomas Lindgaard
    Aug 10, 2004
  3. Will McGugan

    Slow debugging with Komodo

    Will McGugan, Oct 23, 2004, in forum: Python
    Replies:
    5
    Views:
    317
    Trent Mick
    Oct 26, 2004
  4. fortepianissimo
    Replies:
    2
    Views:
    404
    fortepianissimo
    Jan 3, 2006
  5. Replies:
    1
    Views:
    269
    Trent Mick
    Mar 10, 2007
Loading...

Share This Page