Alright this is a simple question, because i don't really know what its called..
Say i have a loop in python
if pattern in buffer:
        while logme == "y":
            logging.basicConfig(filename='hook.log',level=logging.DEBUG)
            logging.debug("Pre-Encrypted: %s" % buffer)
            print "Pre-Encrypted: %s" % buffer
        else:
            print "Pre-Encrypted: %s" % buffer
How can i make it so when i press a keyboard key like P while the loop is running and have it execute a command like pausing the loop, exiting, or doing anything? Like not command line arguments but while the actual program is running..
 
     
     
    