title: How to open a URL in python
body: <pre><code>import urllib
  
  fun open():
      return urllib.urlopen('http://example.com')
  </code></pre>
  <p>But when example.com opens it does not render CSS or JavaScript. How can I open the webpage in a web browser?</p>
  <pre><code>@error(404)
  def error404(error):
      return webbrowser.open('http://example.com')
  </code></pre>
  <p>I am using bottle. Giving me the error:</p>
  <blockquote>
  <pre><code>TypeError(&quot;'bool' object is not iterable&quot;,)
  </code></pre>
  </blockquote>