KeyboardInterrupt

mattia gervaz at gmail.com
Wed Dec 9 19:29:45 EST 2009


Il Wed, 09 Dec 2009 16:19:24 -0800, Jon Clements ha scritto:

> On Dec 9, 11:53 pm, mattia <ger... at gmail.com> wrote:
>> Hi all, can you provide me a simple code snippet to interrupt the
>> execution of my program catching the KeyboardInterrupt signal?
>>
>> Thanks,
>> Mattia
> 
> Errr, normally you can just catch the KeyboardInterrupt exception -- is
> that what you mean?
> 
> Jon.

Ouch, so the simplest solution is just insert in the 'main' function a 
try/catch? I believed there was the necessity to create a signal and than 
attach the KeyboardInterrupt to it...



More information about the Python-list mailing list