code: def start_new_gui_thread():
      
      PyGUIThread = getattr(ROOT, 'PyGUIThread', None)
  
      if PyGUIThread is not None:
          assert not PyGUIThread.isAlive(), "GUI thread already running!"
  
      assert _processRootEvents, (
          "GUI thread wasn't started when rootwait was imported, "
          "so it can't be restarted")
  
      ROOT.keeppolling = 1
      ROOT.PyGUIThread = threading.Thread(
          None, _processRootEvents, None, (ROOT,))
  
      ROOT.PyGUIThread.finishSchedule = _finishSchedule
      ROOT.PyGUIThread.setDaemon(1)
      ROOT.PyGUIThread.start()
      log.debug("successfully started a new GUI thread")
docs: Attempt to start a new GUI thread, if possible.
  
      It is only possible to start one if there was one running on module import.