title: Handling output of python socket recv
body: <p>Apologies for the noob Python question but I've been stuck on this for far too long.</p>
  
  <p>I'm using python sockets to receive some data from a server. I do this:</p>
  
  <pre><code>
  data = self.socket.recv(4)
  print "data is ", data
  print "repr(data) is ", repr(data)
  </code></pre>
  
  <p>The output on the console is this:</p>
  
  <blockquote>
    <p>data is <br/>
    repr(data) is  '\x00\x00\x00\x01'</p>
  </blockquote>
  
  <p>I want to turn this string containing essentially a 4 byte number into an int - or actually what would be a long in C. How can I turn this data object into a numerical value that I can easily manage?</p>