prog1 | prog2 . How not to make prog2 block if not piped?
imcsee at gmail.com
Wed Jun 14 19:28:16 CEST 2006
do u really need read something even when you run the scripts2.py directly?
why not just change script2.py to
if __name__ == "__main__":
print 'passed from else branch'
is it what you want? or anything i misunderstand.
On 14 Jun 2006 08:13:04 -0700, riquito at gmail.com <riquito at gmail.com> wrote:
> I googled around, but couldn't understand how to solve this problem.
> I have 2 scripts
> # script1.py #
> print 'something'
> print 'passed'
> if I run
> script1.py | script2.py
> all goes well.
> But if I run just
> the program blocks waiting forever for input.
> On *nix I used select.select to solve this problem, but on windows?
> I read that maybe I should use, from win32api, GetStdHandle and
> WaitForMultipleObjects, but how to do it it's far from my knowledge.
> Any help?
> Thank you,
More information about the Python-list