I can not organize a cyclical update of the interface. There is a server that, when launched, should output, for example, a notification that it received a new message from the client. Here is the code snippet.
def startServ(): # запускаем его отдельным потоком thread.start_new_thread(taskServer, ()) def taskServer(): print("Server thread started") host = "" port = 50005 sock = socket(AF_INET, SOCK_STREAM) sock.bind((host, port)) sock.listen(10) servStat.put("Ready") # Кидаем сообщение о запуске в очередь ... servStat = queue.Queue() # сама очередь def readServStatus(): # извлечение из очереди try: serverStatus = servStat.get(block=False) except queue.Empty: serverStatus = "Unknown" servLabel["text"] = serverStatus # Сервер запускается из выпадающего меню и действительно работает if __name__ == '__main__': root = Tk() testLabel = Frame(root) testLabel.pack() servLabel = Label(testLabel, text="Server status") root.after(2000, readServStatus) servLabel.pack(side=RIGHT) root.mainloop() In practice, the inscription "Server status" is displayed and after a couple of seconds it changes to "Unknown". It no longer responds to state changes, despite the fact that mainloop () is kind of like a loop. How to make her do it?