1

I have a thread with msvcrt.getch()

I want to kill it.

but if i try to kill it and it's on msvcrt.getch() it will not terminate. It will only terminate once the msvcrt.getch() line is complete.

Anyway to stop this from happening?

  • You can use a `msvcrt.kbhit` in a loop and a flag. See [Python: Stop thread that is waiting for user input](https://stackoverflow.com/questions/25143427/python-stop-thread-that-is-waiting-for-user-input) and the answer linked in the accepted answer. – Nikolaos Chatzis Nov 15 '20 at 10:27

0 Answers0