try
...
except KeyboardInterrupt:
Works in my actual 2025 pycharm on windows 10 without any changes in config or even registry.
Program flow continues after try-except block but program run does not really complete - no return. After hitting stop button again python completes with exit code (-1). How to get (0)?