Pygame Write to another terminal?

I was wondering if it is possible to write pygame code to a separate terminal so that you can do things like print to a terminal. When the pygame display becomes initialized, it seems that it is not possible to insert any input into the terminal. Any way around this?

I also want to know that if it is possible, can another terminal change the one that runs pygame to change some things?

Github

0
source share
1 answer

Well, once you initialize pygame and run the pygame loop in startDisplay () in Commands.py, you essentially leave your main () loop in game.py. Therefore, a repeated request for input will not be repeated. If you want to call input during a loop in startDisplay (), you will need to do it right there. As I said above, this will stop your game until you enter a team that is obviously not very good. You can build a little logic around it and only ask for input during a break in action or implement the Pause event (using the key event), which will subsequently trigger an invitation for the team.

0
source

Source: https://habr.com/ru/post/1490937/


All Articles