Can't Stop Process On Windows

D

Dan

I have a python script running under Windows XP that I need to
terminate from the keyboard. A control-c works fine under Linux, but
not under Windows. I'm pretty sure that the culprit is 'select' that
I'm using to multiplex socket i/o, which seems to be blocking the
keyboard interrupt. Is there some way around this?

Dan
 
D

Dave Brueck

Dan said:
I have a python script running under Windows XP that I need to
terminate from the keyboard. A control-c works fine under Linux, but
not under Windows. I'm pretty sure that the culprit is 'select' that
I'm using to multiplex socket i/o, which seems to be blocking the
keyboard interrupt. Is there some way around this?

Are you calling select with a long timeout? An alternative would be to call
select with a much shorter timeout, but call it multiple times from a loop.
 
D

Dan

Are you calling select with a long timeout? An alternative would be to call
select with a much shorter timeout, but call it multiple times from a loop.

That seems to have fixed the problem. Changed it from no timeout to
one second.

Thanks

Dan
 

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

Forum statistics

Threads
474,234
Messages
2,571,180
Members
47,812
Latest member
Robi2

Latest Threads

Top