5
a = input ()

When I run a program in pycharm, I cannot close it with ctrl + c or ctrl + z. When you press the ctrl + c keys, the whole line is simply copied. Windows 10 system

I can't even handle "except KeyboardInterrupt"

when I emulate the launch in the output console, it still does not work ctrl + s, and if I press ctrl + h, it displays "^ Z" in the console

7
  • 2
    Does this help? Why doesn't this python keyboard interrupt work? (in pycharm) Commented Dec 15, 2020 at 16:44
  • 1
    As shown in the linked question: Check "Emulate Terminal in Output Console" in the run configuration. But in fact, hitting the big red Stop button seems to have the same effect, also triggering a KeyboardInterrupt. Commented Dec 15, 2020 at 16:46
  • @tobias_k when I emulate the launch in the output console, it still does not work ctrl + c, and if I press ctrl + z, it displays "^ Z" in the console. I believe this is a Windows 10 console problem, do you have any suggestions how to fix it? Commented Dec 15, 2020 at 18:44
  • I can not test this with Windows 10 right now. What happens when you hit the big red stop button, does it not send a KeyboardInterrupt like ctrl+c would? About ctrl+z: What should that do? Sending the program to the background does not seem to make much sense in that context. Commented Dec 15, 2020 at 18:47
  • @tobias_k ctrl + z should roughly close the program. And when I close the program myself using the red stop button, it does not count as KeyboardInterrupt Commented Dec 15, 2020 at 18:49

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.