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 - ScrollTo Effect (href to div) -

javascript - ng-class not responding to change in model in Angular? -

javascript - document.registerElement extending HTMLInputElement prototype while using custom tag name to avoid implicit browser style -