[pygtk] Best way to monitor a fifo?

Felix Breuer felix at fbreuer.de
Fri Jan 30 21:46:05 WST 2004


Hello *!

I want to monitor a standard unix fifo from my PyGTK app. Currently I am
using a timeout as in:

def on_timeout():
    input = f.readline()
    if len(input) > 0:
        # do something ...

f = open(fifo_name,"r")
gtk.timeout_add(1000, on_timeout)

But I guess there must be a better way... Which one is it?

Thanks for any suggestions,
Felix


More information about the pygtk mailing list