I am running a few Python scripts at the same time. They are running in windows CMD.
I never knew that you can externally pause a Python script running in CMD.
If I hold the mouse button for a few seconds the script pauses and not just the output the execution as well.
For simplicity's sake I am showing you a very simple example:
while datetime.datetime.now().hour < 16:
print(datetime.datetime.now())
with open("dump.txt", "at") as f:
f.write(f"t: {datetime.datetime.now()}\n")
time.sleep(5)
Both the output to the file and the print to stdout stop if I squeeze the mouse button and they restart when I press enter.
I have two questions, how can I run Python that this type of stops are not possible?
The other is if there some way to detect this type of event in Python(at least the restart).