Ubuntu quickly (python/gtk) - how to monitor stdin?
        Posted  
        
            by neil
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by neil
        
        
        
        Published on 2010-06-07T19:27:23Z
        Indexed on 
            2010/06/07
            19:42 UTC
        
        
        Read the original article
        Hit count: 293
        
pygtk
I'm starting to work with Ubuntu's "quickly" framework, which is python/gtk based. I want to write a gui wrapper for a textmode C state-machine that uses stdin/stdout.
I'm new to gtk. I can see that the python print command will write to the terminal window, so I assume I could redirect that to my C program's stdin. But how can I get my quickly program to monitor stdin (i.e. watch for the C program's stdout responses)? I suppose I need some sort of polling loop, but I don't know if/where that is supported within the "quickly" framework.
Or is redirection not the way to go - should I be looking at something like gobject.spawn_async?
© Stack Overflow or respective owner