I am trying to make it so that the while loop stops when you press c without stopping it using input.
The code I have at the moment is this:
while True:
print("Test")
if msvcrt.kbhit():
if (msvcrt.getch() == "c"):
os._exit(0)
break
elif (msvcrt.getch() != "c"):
continue
FYI I am on windows. Any ideas on how to do it besides the attempt I have already done?