title: Send data between two python Scripts in continous succession
body: <p>I basically want to send data from one python file to the other, then have the other python file send some more data back to the first file, and then the first file send data again, and this goes on until I choose to stop sending data.</p>
  
  <p>server.py:</p>
  
  <pre><code>import socket
  
  s = socket.socket()
  host = "127.0.0.1"
  port = 5409
  s.bind((host, port))
  
  s.listen(1)
  while True:
      c, addr = s.accept()  
      print 'Got connection from', addr
      while True:
          message = raw_input("&gt;&gt;")
          s.sendall(message)
          try:
              print s.recv(1024)
          except:
              print ""
  </code></pre>
  
  <p>client.py:</p>
  
  <pre><code>import socket               
  
  s = socket.socket()         
  host = "127.0.0.1"         
  port = 5409                 
  
  s.connect((host, port))
  while True:
      print s.recv(1024)
      message = raw_input("&gt;&gt;")
      s.send(message)
  </code></pre>
  
  <p>I have been trying for a while and I have found nothing online other than a server and client that send data once between them and then close the connection. What can I do?</p>