Unix Device File Emulation
mblume at freesurf.ch
Wed Apr 23 20:01:39 CEST 2008
> > 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'?
r = self.fifodev.readline()
if r: print r
is ok (note the "if r:" clause).
More information about the Python-list