How to run a thread in the background in python
<p><div class="snippet" data-lang="js" data-hide="false" data-console="true">
<div class="snippet-code">
<pre class="snippet-code-js lang-js prettyprint-override"><code>class CORSRequestHandler (SimpleHTTPRequestHandler):

  def do_GET(self):
    thread1 = threading.Thread(target=test())
    thread1.daemon = True
    thread1.start()
    return SimpleHTTPRequestHandler.do_GET(self)

def test():
    while True:
        print "Hello"
        time.sleep(2)


if __name__ == '__main__':
    BaseHTTPServer.test(CORSRequestHandler, BaseHTTPServer.HTTPServer)</code></pre>
</div>
</div>
</p>

<p>I need to run a server meanwhile printing Hello in the background. Can you please tell me what i am doing wrong because if a try to enter the url the page never loads up. However Hello is being printed and the server does start.</p>