Signal question

I

Ian Pellew

Hi;

I am on WinXPPro and want to catch the keyboard interrupt signal.
Will Python 2.3.3 signal handler catch it?

Cannot find this in the Pyt docs,
Mind nor can I find `inc += 1` statement that I find a poor substitute for `i++`!!

Pointers/Advice Pls.

Regards
Ian
 
M

Miki Tebeka

Hello Ian,
I am on WinXPPro and want to catch the keyboard interrupt signal.
Will Python 2.3.3 signal handler catch it?
from signal import SIGINT, signal
from time import sleep

def sigint_handler(signum, frame):
print "OUCH"

signal(SIGINT, sigint_handler)

while 1:
sleep(1)
print "BEEP"
Mind nor can I find `inc += 1` statement that I find a poor substitute for `i++`!!
Python tries to keep the language as compact as possible. There is no
intension to make it look like C/C++. I don't find these 2 extra chars
annoying.

HTH.
Miki
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,183
Messages
2,570,967
Members
47,517
Latest member
Andres38A1

Latest Threads

Top