nonblocking read()

paul koelle paul at subsignal.org
Tue Nov 16 19:17:47 EST 2004


Peter Ammon wrote:

> Are there better approaches?  Thanks,

What is wrong with:

fp = open('foo', 'r')

while 1:
   line = fp.readline()
   if not line:
     time.sleep(0.3)
     continue
   process(line)

??
  Paul




More information about the Python-list mailing list