title: Python: How to convert the address recieved from a recvfrom() function to a string?
body: <h1>Summary</h1>
  <p>I am adding a feature to a python udp listener that send back an acknowledgement to the device it's receiving from. In my case, at the moment that device is localhost, but in the future will be an MT4000 telemetry device.</p>
  <h1>The problem</h1>
  <p>I am using the recvfrom() function to receive the data and source address from the device sending data. The return value is a pair (string, address) where string is a string representing the data received and address is the address of the socket sending the data. This question us focusing on the address. The address is returning</p>
  <p><code>('127.0.0.1', 57121)</code></p>
  <p>I understand this means the source I.P is <b>127.0.0.1</b> ie localhost, and the <b>57121</b> represents the port that the data has been sent through. My goal is to split this data up in order to send back an acknowledgement.</p>
  <h1>My Solution</h1>
  <p>The code I have receiving the data is this:
  (s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM))
  <code>data, addr = s.recvfrom(1024)</code></p>
  <p>So far I have tried this method of splitting up the data:</p>
  <pre><code>sourceIp = addr[3:-9]
  </code></pre>
  <p>I was under the impression that this should split up the string as such:</p>
  <p><code>sourceIp = 127.0.0.1</code></p>
  <p>It does however only output this: <code>()</code></p>
  <p>My thinking at the moment is that this is not actually a string, and so that method of splitting up does not work. Is there another way of splitting, or method of converting? Thanks.</p>