Prev: 500 tracker orphans; we need more reviewers
Next: scraping from bundes-telefonbuch.de with python
From: shanti bhushan on 19 Jun 2010 02:01 I have a code ,in which i invoke the local webserver in back ground ,then open URL and access the web page. below is my code. I am able to invoke and kill the local webserver in seperate python script,but when i club opening of browser and and subprocess , my like below ,then my script is not responding. Please guide me. import subprocess import time subprocess.Popen(r'C:\WINDOWS\system32\cmd.exe /C "D:\372\pythonweb \mongoose-2.8.exe -root D:\New1\ >YourOutput.txt"') webbrowser.open("http://43.88.79.229:8080/index.html/") time.sleep(11) subprocess.Popen(r'C:\WINDOWS\system32\cmd.exe /c "taskkill /F /IM mongoose-2.8.exe >YourOutput1.txt"') # kill in back ground time.sleep(3) subprocess.Popen(r'C:\WINDOWS\system32\cmd.exe /C "D:\372\pythonweb \mongoose-2.8.exe -root D:\New1\ >YourOutput.txt"') webbrowser.open("http://43.88.79.229:8080/index.html/") time.sleep(11) subprocess.Popen(r'C:\WINDOWS\system32\cmd.exe /c "taskkill /F /IM mongoose-2.8.exe >YourOutput1.txt"') # kill in back ground time.sleep(3) subprocess.Popen(r'C:\WINDOWS\system32\cmd.exe /C "D:\372\pythonweb \mongoose-2.8.exe -root D:\New2\ >YourOutput.txt"') webbrowser.open("http://43.88.79.229:8080/index.html/")
From: shanti bhushan on 19 Jun 2010 02:48 On Jun 19, 11:01 am, shanti bhushan <ershantibhus...(a)gmail.com> wrote: > I have a code ,in which i invoke the local webserver in back > ground ,then open URL and access the web page. > below is my code. > I am able to invoke and kill the local webserver in seperate python > script,but when i club opening of browser and and subprocess , my like > below ,then my script is not responding. > Please guide me. > > import subprocess > import time > subprocess.Popen(r'C:\WINDOWS\system32\cmd.exe /C "D:\372\pythonweb\mongoose-2.8.exe >YourOutput.txt"') time.sleep(3) webbrowser.open("http://43.88.79.229:8080/index.html") time.sleep(11) subprocess.Popen(r'C:\WINDOWS\system32\cmd.exe /c "taskkill /F /IM mongoose-2.8.exe >YourOutput1.txt"') # kill in back ground time.sleep(3) subprocess.Popen(r'C:\WINDOWS\system32\cmd.exe /C "D:\372\pythonweb \mongoose-2.8.exe -root D:\New1\ >YourOutput.txt"') time.sleep(3) webbrowser.open("http://43.88.79.229:8080/index.html") time.sleep(11) subprocess.Popen(r'C:\WINDOWS\system32\cmd.exe /c "taskkill /F /IM mongoose-2.8.exe >YourOutput1.txt"') # kill in back ground time.sleep(3) subprocess.Popen(r'C:\WINDOWS\system32\cmd.exe /C "D:\372\pythonweb \mongoose-2.8.exe -root D:\New2\ >YourOutput.txt"') time.sleep(3) webbrowser.open("http://43.88.79.229:8080/index.html") time.sleep(11) subprocess.Popen(r'C:\WINDOWS\system32\cmd.exe /c "taskkill /F /IM mongoose-2.8.exe >YourOutput1.txt"') # kill in back ground This scripts works fine with python 26 in windows XP, but when i replace the browser opening part with broswer to be open on different machine in python made tool.That it always give me warning that process already open.If i kill the the command then also it gives same problem. Please guide me is it sycronisation issue?,some exception handling is required??
From: shanti bhushan on 19 Jun 2010 03:06 On Jun 19, 11:01 am, shanti bhushan <ershantibhus...(a)gmail.com> wrote: > I have a code ,in which i invoke the local webserver in back > ground ,then open URL and access the web page. > below is my code. > I am able to invoke and kill the local webserver in seperate python > script,but when i club opening of browser and and subprocess , my like > below ,then my script is not responding. > Please guide me. > > import subprocess > import time > subprocess.Popen(r'C:\WINDOWS\system32\cmd.exe /C "D:\372\pythonweb > \mongoose-2.8.exe -root D:\New1\ >YourOutput.txt"') > webbrowser.open("http://43.88.79.229:8080/index.html/") > time.sleep(11) > subprocess.Popen(r'C:\WINDOWS\system32\cmd.exe /c "taskkill /F /IM > mongoose-2.8.exe >YourOutput1.txt"') # kill in back ground > time.sleep(3) > subprocess.Popen(r'C:\WINDOWS\system32\cmd.exe /C "D:\372\pythonweb > \mongoose-2.8.exe -root D:\New1\ >YourOutput.txt"') > webbrowser.open("http://43.88.79.229:8080/index.html/") > time.sleep(11) > subprocess.Popen(r'C:\WINDOWS\system32\cmd.exe /c "taskkill /F /IM > mongoose-2.8.exe >YourOutput1.txt"') # kill in back ground > time.sleep(3) > subprocess.Popen(r'C:\WINDOWS\system32\cmd.exe /C "D:\372\pythonweb > \mongoose-2.8.exe -root D:\New2\ >YourOutput.txt"') > webbrowser.open("http://43.88.79.229:8080/index.html/") if i want to put exception handing for invoking the local web server ?? how to do that please guide
|
Pages: 1 Prev: 500 tracker orphans; we need more reviewers Next: scraping from bundes-telefonbuch.de with python |