When I run the following code:
 
import os
 
file = "C:\\progra~1\\mozill~1\\firefox.exe www.google.com"
os.system(file)                                                                  # this will spawn Firefox and naviage to google.com
 
kill = "taskkill /f /im firefox.exe"
os.system(kill)                                                                  # this should kill Firefox instance that was just spawned
 
 
 
the script never gets to kill the insance of firefox. When I manually close Firefox, my cmd window indicates that the taskkill command was unsuccessful, which leads me to believe that after I open Firefox the system is not getting any indication that the command finished executing, which would result in Firefox not being killed. I also tried substituting " os.system" with "os.popen" which did the same thing.
 
Anyone have an idea how I can kill the instance of Firefox?
 
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to