Allow closing the event loop via keyboard interrupt
See original GitHub issueWhen I run the example cube.py
(or any other example) with pyside6 as GUI backend then a Ctrl+C (KeyboardInterrupt
) on the terminal will be reported in the shell but won’t actually do anything. Would it be possible to add a listener for this that will then close all open windows and terminate the event loop, so that the program exists on Ctrl+C?
Issue Analytics
- State:
- Created 10 months ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
What's the correct way to clean up after an interrupted event ...
When you CTRL+C, the event loop gets stopped, so your calls to t.cancel() don't actually take effect. For the tasks to be cancelled, ......
Read more >RuntimeError after ctrl-C interrupt when asyncio is closing the ...
When a loop is closed, it tries to shut down its default executor. This is done by creating a helper thread (in shutdown_default_executor()...
Read more >Issue 39622: Handle KeyboardInterrupt in asyncio
When using an event loop it makes sense to handle a signal as an event an process it along with the other running...
Read more >Complete Guide to Python KeyboardInterrupt - eduCBA
Guide to Python KeyboardInterrupt. Here we discuss how KeyboardInterrupt exception work, how to avoid KeyboardInterrupt exceptions in Python.
Read more >How to ensure asyncio task exceptions always get logged
There is one major problem with asyncio's event loop error handler ... 24 except KeyboardInterrupt: 25 logging.info('Closing the loop') 26 ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Short answer is yes but it is challenging.
Long answers you can find if you google how to support keyboard interrupt for pyside/pyqt.
I guess so?