FAQ
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/")

Search Discussions

  • Shanti bhushan at Jun 19, 2010 at 6:48 am

    On Jun 19, 11:01?am, shanti bhushan 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??
  • Shanti bhushan at Jun 19, 2010 at 7:06 am

    On Jun 19, 11:01?am, shanti bhushan 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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedJun 19, '10 at 6:01a
activeJun 19, '10 at 7:06a
posts3
users1
websitepython.org

1 user in discussion

Shanti bhushan: 3 posts

People

Translate

site design / logo © 2022 Grokbase