user interface - Launching and waiting a GUI app to finish with Python -
i need launch gui application, wait application quit, , start other processes.
import subprocess res = subprocess.check_output(["/usr/bin/open", "-a", "/applications/mou.app", "p.py"]) print "finished" ... start other processes
however, process returns right away without waiting mou.app finish. how can make python process wait? use mac os x.
according the open
man page, -w
flag causes open
wait until app exits.
therefore try:
import subprocess res = subprocess.check_output(["/usr/bin/open", "-a", "-w", "/applications/mou.app", "p.py"]) print "finished"
Comments
Post a Comment