title: Socket module, how to send integer
body: <p>I am reading in a value on the client side and want to send that to a server side so it can check if its prime. I'm getting an error because the server is expecting a string</p>
  
  <p><strong>server side</strong></p>
  
  <pre><code>import socket
  
  tcpsocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  tcpsocket.bind( ("0.0.0.0", 8000) ) 
  
  tcpsocket.listen(2)
  (client, (ip,port) ) = tcpsocket.accept()
  
  print "received connection from %s" %ip
  print " and port number %d" %port
  
  client.send("Python is fun!") 
  </code></pre>
  
  <p><strong>client side</strong></p>
  
  <pre><code>import sys
  import socket
  
  tcpsocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 
  
  num = int(raw_input("Enter number: "))
  
  tcpsocket.connect( ('192.168.233.132', 8000) ) 
  tcpsocket.send(num)
  </code></pre>
  
  <p><code>Error: must be string or buffer, not int.</code></p>
  
  <p>How can I resolve this?</p>