Why don't the signals emit? Why don't the signals emit? python-3.x python-3.x

Why don't the signals emit?


Your interpreter thread is blocking on the InteractiveConsole.runcode() call. It will not be able to process any signals until this call completes. That is why you see the delayed output.

You can get the effect you're after by changing

self.interpreter.output.connect(self.send_console_log)

to

self.interpreter.stream.output.signal_str.connect(self.send_console_log)

For some old school debugging, disconnect you're stderr handling and sprinkle some print statements around like...

print('runcode after', file=sys.stderr)