title: Python Thread Not Starting
body: <p>Mashing code from a few different sources I am trying to make a python chat client. I can connect to the server but I want to use two threads so I can send and recieve messages at the same time. I am new to python and cannot get my threads to work. My python version is 2.7.5</p>
  
  <pre><code>#!/usr/bin/python
  
  import sys
  import socket
  import time
  import threading
  
  # Define a function for the thread
  def sendChat( socket, name):
      userInput = ""
      while userInput != "exit":
          userInput = raw_input("What do you want to say")
          userInput = (userInput+'\r\n')
          socket.send(userInput)
      socket.close
  
  print "Hello, Python!"
  
  userName = raw_input("What would you like your user name to be:")
  print (userName + " welcome to chatclient, connecting to server now...")
  s = socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0)
  host = socket.gethostname() # Get local machine name
  port = 4444
  s.connect((host, port))
  print "... connected to server!"
  try:
     thread.start_new_thread( sendChat, (s, "sendChat" ) )
  except:
     print "Error: unable to start thread"
  
  time.sleep(100)
  </code></pre>
  
  <p>Here is what I get when I run it:</p>
  
  <pre><code>Ryans-MacBook-Pro:network ryan$ python chatclient.py
  Hello, Python!
  What would you like your user name to be:ryan
  ryan welcome to chatclient, connecting to server now...
  ... connected to server!
  Error: unable to start thread
  </code></pre>
  
  <p>I have seen that the main thread can end before the new one so I tried add the sleep at the end but that didn't work.</p>