Mag Gam wrote on 2010-09-28 06:41:
> I run my program like this, cat foo | python code.py. How can I keep
> my stdin without urwid exiting prematurely?
> 

So, you want urwid to connect to the controlling tty instead of using stdin?

If so you could do something like:

    old_stdin = sys.stdin
    sys.stdin = .. # the file object for Urwid input
    screen = urwid.raw_display.Screen()
    sys.stdin = old_stdin
    loop = urwid.MainLoop(.., screen=screen)

Then urwid won't pay any attention to stdin.


_______________________________________________
Urwid mailing list
Urwid@lists.excess.org
http://lists.excess.org/mailman/listinfo/urwid

Reply via email to