title: Python; convert from .txt line with readline() to tuple
body: <p>I'm making a client in python, the problem comes when I wanna use an ip and a port  (separated by a space) from a .txt file to use it for <strong>.sendto(msg,(data))</strong> </p>
  
  
  
  <pre><code>import socket
  import sys
  import os
  
  sUDP = socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
  
  file = open("./file.txt")
  data1 = file.readline()
  msg = "hi"
  
  sUDP.sendto(msg, (data1)) #THE ERROR
  </code></pre>
  
  <p>The ./file.txt contains:</p>
  
  <p>127.0.0.1 40000</p>
  
  <p>127.0.0.1 55000</p>
  
  <p>
  I would like sUDP.sendto(msg, (data1)) to work properly or know how to convert the first read line in order to separate ip and port to make a tuple to make sendto work</p>
  
  <p>
  This is the console when i want to compile:</p>
  
  <p><strong>Traceback (most recent call last):
    File "cliente.py", line whatever, in 
      sUDP.sendto(msg, (data1)) #THE ERROR
  TypeError: getsockaddrarg: AF_INET address must be tuple, not str</strong></p>
  
  <p>Thank you for all the people helping me! I gotta finish this work soon</p>
  
  <p><strong>EDIT:</strong> 
  I discovered that using .split() I can make two separated strings using one with an space. The only thing I had to do is to convert the port to int using int(port) and we can make the tuple! By the way i there's a more efficient way of making tuples from the file.txt tell me thank you!</p>