Questions tagged [keyboardinterrupt]

280 questions
0
votes
1 answer

How to send interrupt/ ctrl C during execution of expect script

I am trying to execute some commands and one of which will not come back to console and need to explicitly bring it using ctrl+ c. After that I need to execute some more commands in that script. expect "$ " send "sh…
Karthik
  • 3
  • 3
0
votes
1 answer

Is there any way to check whether the interrupt is handled or not?

Suppose my CPU is hogged down and I want to check whether any coming interrupt from any hardware device is handled or not? eg: on pressing keyboard CPU is giving no response, then I want to know whether processor handled my keyboard interrupt or…
0
votes
0 answers

Python 3.4.3 KeyboardInterrupt works but does not run code inside its block

I am doing some Python tutorials to try and learn as much as possible about the language and I am having some problems with exception handling. I am running the code in cmd in Windows 10 using Python 3.4.3. Specifically, the KeyboardInterrupt block…
smkarber
  • 577
  • 5
  • 18
0
votes
1 answer

python multiprocess.Pool can not process KeyboardInterrupt right?

I want to terminate my program when press Ctrl-C, code as follow: #!/usr/bin/env python # encoding: utf-8 import multiprocessing import time import signal import sys def init_worker(): signal.signal(signal.SIGINT, signal.SIG_IGN) def…
roger
  • 9,063
  • 20
  • 72
  • 119
0
votes
2 answers

Is it possible to create a decorator inside a class?

Or maybe you can think of an alternative solution to what I'm trying to do. Basically I have a class with a bunch of functions that I want to wrap in try/except blocks to intercept the KeyboardInterrupt error as I have a function that tidily cleans…
0
votes
1 answer

How to change objects in a python script by using a keyboardinterrupt for specific keys?

After looking at the KeyboardInterrupt to exit out of a multithreaded script I was wondering if it's possible to use the up and down keys on a keyboard to increase/decrease the number of threads being used? This would hopefully happen the same…
Jeff
  • 180
  • 1
  • 11
0
votes
1 answer

Assembly Language 8086 Keyboard and Mouse Interrupt

I am having trouble figuring out how to implement a keyboard and mouse interrupt for my matrix program to make my never ending matrix program terminate once any key on the keyboard has been pressed and/or when the mouse has been moved, as well as…
AlternateRealm
  • 27
  • 1
  • 4
  • 8
0
votes
2 answers

Pause for an event in python tkinter

I am using a python 2.7 tkinter gui on a raspberry pi to automate some material testing. For the testing, multiple samples must be tested and it takes time to swap out the samples. I want to prompt text saying something like "Please insert sample…
BDP
  • 191
  • 1
  • 4
  • 11
0
votes
0 answers

How to abort a python script, but stay in the ipython interface?

Sometimes while executing a python script or while executing some command, it takes a long time to complete and I would like to abort the script or command. When I use Ctrl-C, nothing happnes. And when I use Ctrl-Z, the whole ipython interface exits…
Mi2n
  • 11
  • 2
0
votes
2 answers

How to set push-button to keyboard interrupt in PyQt

While running program through the terminal we can stop the program by pressing 'Ctrl+c' and it will show the message as 'KeyboardInterrupt' . So, is there any way to do the sane thing by clicking the push-button in PyQt.
lkkkk
  • 1,999
  • 4
  • 23
  • 29
0
votes
1 answer

Have ctrl+c interrupt a blocking system call

Here is a slimmed down example of the code I'm working with: void SleepIntr() { printf("Entering sleep...\n"); SleepEx(10000, TRUE); printf("Sleep done...\n"); } static BOOL WINAPI ctrl_handler(DWORD dwCtrlType) { …
0
votes
3 answers

Python Threading - Managing thread termination and the main thread

Before you read on, know that I'm new to Python and very new to threading so forgive me if I misunderstand how threads work or make a rookie error :P Short description of my goal: The main thread (a) does some things (e.g. prints "begin!") Main…
Jazcash
  • 3,145
  • 2
  • 31
  • 46
0
votes
1 answer

Need help hooking new keyboard interrupt in MS-DOS

I am working on an assignment for an assembly class. I have previously managed to make my timer interrupt display and update a 'clock' at every tick. I am attempting to use this knowledge to replace my keyboard interrupt. But even when I comment…
0
votes
0 answers

How can I make a screen blink in TSR program?

I have written a program which acts as a screensaver i.e after 10 seconds all the command prompt screen is cleared if no keyboard button is pressed. In short I have hooked Timer and Keyboard interrupt. But I want the program to show blinking screen…
Hammad
  • 177
  • 1
  • 3
  • 10
0
votes
1 answer

KeyboardInterrupt in Windows?

How to generate a KeyboardInterrupt in Windows? while True: try: print 'running' except KeyboardInterrupt: break I expected CTRL+C to stop this program but it doesn't work.
dugres
  • 12,613
  • 8
  • 46
  • 51
1 2 3
18
19