![]() ![]() You can even use tmux itself for signalling:Īfter running this command, run and wait for tmux wait -L myscript Įdit your script or the 'source' command to run tmux wait -U myscript when finished. ![]() In the official python documentation we can read that subprocess should be usedfor accessing system commands. The main reason for that, was that I thought that was the simplest way ofrunning Linux commands. You can do the above using some other form of IPC (e.g. Subprocess Overview For a long time I have been using os.system() when dealing with systemadministration tasks in Python. (This of course requires adding an 'echo' command at the end of the script, or after the 'source' command.) your script) actually writes something there. This will wait until another program (e.g. You can create a named pipe and try to read from it. You can use inotify (Linux) or kqueue (FreeBSD) to watch the directory the kernel will tell you when the file shows up. You can poll (periodically check) whether the file has showed up. This is a poor method of running a script, but if you must use it, then your options are limited: ![]() It even doesn't know that those keypresses actually correspond to a script, much less know when that script is going to finish. You aren't telling tmux to run a command and wait you're telling it to simulate some keypresses. In fact, even tmux doesn't have this information. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |