Show More
@@ -16,6 +16,11 b' Author: Christian Boos' | |||||
16 | # Imports |
|
16 | # Imports | |
17 | #----------------------------------------------------------------------------- |
|
17 | #----------------------------------------------------------------------------- | |
18 |
|
18 | |||
|
19 | import os | |||
|
20 | import signal | |||
|
21 | import time | |||
|
22 | import threading | |||
|
23 | ||||
19 | from IPython.core.interactiveshell import InteractiveShell |
|
24 | from IPython.core.interactiveshell import InteractiveShell | |
20 | from IPython.external.qt_for_kernel import QtCore, QtGui |
|
25 | from IPython.external.qt_for_kernel import QtCore, QtGui | |
21 | from IPython.lib.inputhook import allow_CTRL_C, ignore_CTRL_C, stdin_ready |
|
26 | from IPython.lib.inputhook import allow_CTRL_C, ignore_CTRL_C, stdin_ready | |
@@ -117,13 +122,12 b' def create_inputhook_qt4(mgr, app=None):' | |||||
117 | ignore_CTRL_C() |
|
122 | ignore_CTRL_C() | |
118 | got_kbdint[0] = True |
|
123 | got_kbdint[0] = True | |
119 | mgr.clear_inputhook() |
|
124 | mgr.clear_inputhook() | |
120 | import os, signal, time, threading |
|
|||
121 | if(os.name == 'posix'): |
|
125 | if(os.name == 'posix'): | |
122 | pid = os.getpid() |
|
126 | pid = os.getpid() | |
123 | print("^C") |
|
127 | print("^C") | |
124 | thread = threading.Thread( |
|
128 | thread = threading.Thread( | |
125 | target = lambda: |
|
129 | target = lambda: | |
126 | ( time.sleep(.1), |
|
130 | ( time.sleep(.01), | |
127 | os.kill(pid, signal.SIGINT) ) |
|
131 | os.kill(pid, signal.SIGINT) ) | |
128 | ) |
|
132 | ) | |
129 |
|
133 |
General Comments 0
You need to be logged in to leave comments.
Login now