windows - Python - how to run the application and leave until it end? -
how can run application , leave instead of waiting when ended? example : /var/tmp/runme.sh &
following code working waits forever when google chrome exit. how can run google chrome let script exit?
import subprocess import sys import time line = sys.argv[1] print line def kill_chrome(): subprocess.call(['taskkill', '/im', 'chrome.exe', '/f']) def run_chrome(): subprocess.call(['c:/program files (x86)/google/chrome/application/chrome.exe', '--kiosk']) def run_java(): subprocess.call(['java', '-cp', 'c:/python27/pdfbox-app-2.0.0-rc3.jar;c:/python27/jprint.jar', 'jprint']) try: if line.startswith("myjava:website"): print "google chrome - idle" run_chrome() elif line.startswith("myjava:a4"): print "printing - java" run_java() elif line.startswith("myjava:kill"): print "killer" kill_chrome() except exception, err: print (err) pass #time.sleep(2)
what subprocess.popen? looks want - runs app end not waiting. pass arguments runned application.
from subprocess import popen popen( [ "c:/program files (x86)/google/chrome/application/chrome.exe", "myarg"])
without "myarg" works too.
@admin
ReplyDeleteThese are the values that we hold central to our practice. We create beautiful smiles as we focus on the overall health of your mouth. We encourage you to call or email us with any questions or concerns that you have so that we can better serve you.
Regards,
Dentist In unionville, CT