On Windows it looks like msvcrt will give you a non-blocking terminal read -- on mac / *nix systems it looks a little trickier:
http://mail.python.org/pipermail/pythonmac-sig/2004-February/010140.html The os module in windows doesn't even have O_NONBLOCK. That seems like trouble. m On Sun, 20 Feb 2005 20:55:40 +0530, Varun Soundararajan <[EMAIL PROTECTED]> wrote: > Hi, > I want to know how to do this: > I have an executable file, which reads input from stdin provided > output at stdout or stderr. > I have to run it for a specific period of time (say 5 secs), get the > output and display it. > If i use popen(), this way: > from subprocess import * > p = Popen(["test","<test.in"," >test.out"], shell=True) > p.wait() > print p.stdin,p.stdout > I dont get output in p.stdout.Apart from this, can u say how to stop > this subprocess after 5 secs (or whatever time frame specified)? > signal SIGALRM may not work (as i want it to work in windows & unix). > -Varun > _______________________________________________ > Tutor maillist - Tutor@python.org > http://mail.python.org/mailman/listinfo/tutor > _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor