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

Popular posts from this blog

javascript - How to synchronize the Three.js and HTML/SVG coordinate systems (especially w.r.t. the y-axis)? -

javascript - How do I find how many occurences are there of a highlighted string, and which occurence is it? -

java - Reading data from multiple zip files and combining them to one -