Bind key press to call function

Chris Angelico rosuav at gmail.com
Thu Nov 24 01:20:30 EST 2011


On Thu, Nov 24, 2011 at 5:07 PM, Steven D'Aprano
<steve+comp.lang.python at pearwood.info> wrote:
>> This looks like the classic "sigint handler sets a flag that the main
>> loop polls" structure.
>
> Exactly. I am open to alternative methods if they are lightweight.

Might be easiest to spin off a thread to do the work, and then have
the main thread block on the keyboard.

ChrisA



More information about the Python-list mailing list