title: How to print and send changing IDs though python to another computer with sockets
body: <p>Basically, I have my code, which finds the Lobby ID of a video-game, which then sends to my laptop. This then opens the exe with a argument and that certain Lobby ID. I want it to change when I start up another game/server. I have the script to output when the lobby ID changes, but when I plug it into my socket script. It only outputs the first one.</p>
  
  <p>If I hash out all the s= socket... part and under it functions correctly</p>
  
  <pre><code>import socket
  import glob
  import os
  import re
  placeholder = ''
  
  s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
  host = '192.168.0.17'
  port = 50502
  s.connect((host,port))
  
  while True:
  
      GAME_DIRECTORY = 'C:/Program Files/Oculus/Software/Software/ready-at-dawn-echo-arena'
  
      logs = glob.glob(GAME_DIRECTORY + '/_local/r14logs/*')
      log = max(logs, key = os.path.getctime)
      with open(log, 'r') as f:
          file = f.read()
  
      lobbyid = re.findall(r'........-....-....-....-............', file)[-1]
      if lobbyid != placeholder:
          if lobbyid != ('00000000-0000-0000-0000-000000000000'): 
              placeholder = lobbyid  
              print (lobbyid)
  
              def ts(str):
                  s.send(lobbyid.encode()) 
                  data = ''
                  data = s.recv(1024).decode()
                  s.close ()
              ts(s)
  </code></pre>