Python 3 non-blocking synchronous behavior
问题 I'm making the classic atari snake game in python3 using Pygame. I want to spawn a subprocess to listen for key strokes so that whenever the player enters a key (UP, DOWN, LEFT, or RIGHT), the subprocess sends the parent process the key. But this pipe should not be blocking, so that the snake can travel in the direction it was traveling until the key is received. I found Python's official documentation on multi-processes, but it does not describe the behavior I want, or at least doesn't