"blaine" schrieb > > > > while 1: > > r = self.fifodev.readline() > > if r: print r > > > > According to my docs, readline() returns an empty > > string at the end of the file. > > Also, you might want to sleep() between reads a > > little bit. > > > > Oh ok, that makes sense. Hmm. So do I not want to use > readline()? Or is there a way to do something like > 'block until the file is not empty'? >
No, while 1: r = self.fifodev.readline() if r: print r else: time.sleep(0.1) is ok (note the "if r:" clause). Martin -- http://mail.python.org/mailman/listinfo/python-list