title: python daemon stdout,stderr redirect; how to?
body: <p>I have this small snippet of my larger py file, wherein I'm trying to redirect the stdout,stderr to two separate files on my desktop. </p>
  
  <p>FYI: I could successfully run the same lines without daemon. (#thread.daemon  = True)
  Let me know if I have to provide further details.</p>
  
  <p>[PS: I'm actually trying to run seleniumRC script in the same function]</p>
  
  <pre><code>def onCallDelete():
      tenantId="Codebreakers"
      import time,os, sys
      time.sleep(2)
      os.chdir('/Users/pie/Desktop')
      sys.stdout = open('stdoutf.txt', 'w') #assigning file descriptor
      sys.stderr = open('stderrf.txt', 'w') #assigning file descriptor
      sys.stdout.write("hellooooe, this logs to a file")
  
      sys.stdout.close()
      sys.stderr.close()
  
  thread = threading.Thread(target=onCallDelete)
  thread.daemon  = True
  thread.start()
  </code></pre>