title: How to implement a ever running loop within a PySimpleGUI code?
body: <p>I couldnt something problem solving anywhere, so I think its time to post this question myself.</p>
  <p>Here is my code:</p>
  <pre><code>import serial
  from serial import Serial
  import PySimpleGUI as sg
  
  
  
  ser = serial.Serial('COM3', 115200, timeout=1)
  read = False
  
  sg.theme('DarkAmber')
  layout = [  [sg.InputText(), sg.Button('Empfindlichkeit einstellen')],
              [sg.Button('start'), sg.Button('end')] ]
  
  window = sg.Window('Window Title', layout)
  
  
  
  while True:
      event, values = window.read()
  
      if read == True:
          reading = ser.readline()
          print(reading[0:256])
  
      if event == &quot;start&quot;:
          read = True
  
      if event == sg.WIN_CLOSED or event == 'end':
          break
  
  window.close()
  </code></pre>
  <p>The GUI shows up just perfectly fine and there are no errors. But the problem is the following part:</p>
  <pre><code>    if read == True:
          reading = ser.readline()
          print(reading[0:256])
  </code></pre>
  <p>This part of the code should run continuously when I pressed the button that says &quot;start&quot; once. But it doesnt. This part of the code just get executed one time, whenever I have pressed start once and then any other button. How can I fix this?</p>