I'm working with a Python script and I have some problems on delaying the execution of a Bash script.
My script.py lets the user choose a script.sh, and after the possibility to modify that, the user can run it with various options.
One of this option is the possibility to delay of N seconds the execution of the script, I used time.sleep(N) but the script.py totally stops for N seconds, I just want to retard the script.sh of N seconds, letting the user continue using the script.py.
I searched for answers without success, any ideas?
subprocessmodule and create your ownPopenobject, yourbashscript won't block and you can put thesleepcommand at the beginning of it.$EDITOR(typically with a default ofvior otherwise something guaranteed to be available), and waiting for that editor to exit before proceeding. Witness git and svn prompting for commit messages that way, for example.