How to run pynput.Listener simultaneously with tkinter.Tk().mainloop()
问题 I am a teacher. I teach math, but since education is facing human resources crisis, I have some additional duties. I teach kids a bit of programming, they do quite well. Now I'd like to make with them a snake game, but I have a problem achieving multithreading in my GUI app. I found similar cases but no solutions. Like here: Using the keyboard to move the character in a maze and here: Tkinter.Tk() and threading def on_press(key): print('{0} pressed'.format(key)) def on_release(key): if key ==