prog1 | prog2 . How not to make prog2 block if not piped?

riquito at riquito at
Wed Jun 14 19:40:15 CEST 2006

imcs ee ha scritto:

> do u really need read something even when you run the directly?
> why not just change to
> if __name__ == "__main__":
>     print 'passed'
> else:
>     print 'passed from else branch'
> is it what  you want? or anything i misunderstand.

it won't do. clever btw.
Script2 is not a module, it's a program that _could_ receive input via

More information about the Python-list mailing list