title: Threading script not printing to console
body: <p>this is really baffling me, and I cannot find the answer.</p>
  
  <pre><code>import thread
  import time
  import random
  import sys 
  
  sys.stdout.flush()
  
  def run_often(thread_name, sleep_time):
      while True:
          time.sleep(sleep_time)
          print "%s" % (thread_name)
  def run_randomly(thread_name, sleep_time):
      while True:
          time.sleep(sleep_time)
          print "%s" % (thread_name)
  
  thread.start_new_thread(run_often,("Often runs", 2)) 
  thread.start_new_thread(run_randomly, ("Fast and random", random.random()))
  </code></pre>
  
  <p>the problem is that this does not print. In the terminal, I type python threading.py (that's the file name) and no error is output. So the code compiles but it just does not print. In other words, this is what happens: </p>
  
  <pre><code>$ python threading.py
  $ 
  </code></pre>
  
  <p>I added sys.stdout.flush() thinking that stdout needed to be reset, but to no avail. And when I add a random print statement like "hello world" outside of the while loop in any of the functions, it gets printed. Also, when I run the exact same code in ipython, it prints perfectly. This was copied from a YouTube tutorial, and is not my own code. </p>
  
  <p>Any ideas as to why it's not printing? The Python I'm running is 2.7.8.
  Thanks in advance.</p>