question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow closing the event loop via keyboard interrupt

See original GitHub issue

When 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:open
  • Created 10 months ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
Korijncommented, Nov 7, 2022

Short answer is yes but it is challenging.

Long answers you can find if you google how to support keyboard interrupt for pyside/pyqt.

0reactions
almarkleincommented, Nov 8, 2022

I guess so?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found