read stdout/stderr without blocking

Jacek Popławski jpopl at interia.pl
Mon Sep 12 08:39:42 EDT 2005


>         ready = select.select(tocheck, [], [], 0.25) ##continues after 0.25s
>         for file in ready[0]:
>             try:
>                 text = os.read(file, 1024)

How do you know here, that you should read 1024 characters?
What will happen when output is shorter?



More information about the Python-list mailing list