Reputation: 848
I am using Python 3.7 in Windows 10 as Development Environment. I wrote a continuous time application and I run my python script on command Prompt as:
cmd: runpythonscript.py
However if you put your mouse on the command prompt and click it, the command prompt pauses the code. I don't want any outside interrupt from command prompt unless it is closed.
Is there a way to do this?
Here a simple real time code that can be tried:
import time
def main():
is_running = True
time_slept = 0
while is_running:
time.sleep(1)
print("I slept " + str(time_slept) +" seconds")
time_slept += 1
if __name__ == '__main__':
main()
Upvotes: 2
Views: 304
Reputation: 150
This is actually default behaviour on most terminals on Linux. If you enter copy mode, the process is paused. You may remove the quick edit mode
to achieve your desired behavior:
Sorry for the german labels, windows is really sick if you want to change the language. The stuff should be on the same place.
Upvotes: 1