title: How can I run a local server and open urls from the same python program?
body: <p>I want to start a local server and then open a link with a browser from the same python program.</p>
  
  <p>This is what I tried (a very naive and foolish attempt):</p>
  
  <pre><code>from subprocess import call
  import webbrowser
  
  call(["python", "-m", "SimpleHTTPServer"]) #This creates a server at port:8000
  webbrowser.open_new_tab("some/url")
  </code></pre>
  
  <p>However, the program doesn't go to the second statement because the server is still running in the background. To open the browser, I need to exit the server which defeats the purpose of running the server.</p>
  
  <p>Can anyone help me by suggesting a working solution?</p>