Can I have a running python script(under Windows)being paused in the middle by user , and resume again when user decides ?
There is a main manager program which gen
I found so hacky those responses, while being interesting too.
The best approach is the https://stackoverflow.com/a/7184165/2480481 doing it using KeyboardInterrupt exception.
As i noticed nobody mention "using a debugger", i'll do it.
Install pdb, Python debugger with pip install pdb.
Follow that to make your script pausable https://stackoverflow.com/a/39478157/2480481 by Ctrl+c instead of exit it.
The main benefit of using a debugger (pdb) is that you can inspect the variables, values, etc. This is far way more powerfull than just pause/continue it.
Also, you can add Ipython interface with pdb attached to debug your app when crashes. Look at: https://stackoverflow.com/a/14881323/2480481