title: Threading Set Daemon not working
body: <p>A very simple script.</p>
  
  <p>test.py</p>
  
  <pre><code>import temp
  temp.start()
  </code></pre>
  
  <p>temp.py</p>
  
  <pre><code>import threading, time
  f=open("output.txt","w")
  def temp():
      for i in range(5):
          f.write(str(i))
          time.sleep(5)
      f.close()
  def start():
      t=threading.Thread(target=temp)
      t.setDaemon(True)
      t.start()
  </code></pre>
  
  <p>I expected Daemon thread to complete as main process <code>test.py</code> exits immediately.But the <code>daemon</code> thread exits with the main and does not act like a <code>daemon</code>.Am i missing something basic here?</p>