Python - react to custom keyboard interrupt
        Posted  
        
            by flixic
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by flixic
        
        
        
        Published on 2010-05-21T13:29:41Z
        Indexed on 
            2010/05/21
            13:30 UTC
        
        
        Read the original article
        Hit count: 294
        
Hello. I am writing python chatbot that displays output through console. Every half second it asks server for updates, and responds to message. In the console I can see chat log.
This is sufficient in most cases, however, sometimes I want to interrupt normal workflow and write custom chat answer myself. I would love to be able to press a button (or combination) that would switch to "custom reply mode". What is the best way to do that, or achieve similar result?
Thanks a lot!
© Stack Overflow or respective owner