I was wondering if there is a way, in python, that while my graphical piece inside my games.screen.mainloop() is running, if I can do something like get user input through raw_input() from the console.
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
- Correctly parse PDF paragraphs with Python
The thing is about that is if you do something like
raw_input
it will stop the program until that input is entered so that will stop the program every loop to take input but you can do things likeprint
but they will print every loopif you want to take input use InputBox Module this will make a little input box pop up on the screen thats in the loop
if you want to do it from the console you could try Threading it which im not to familiar with but you can check it out Multi-threading Tutorial
here is a questions that might help you out
Pygame writing to terminal
Good Luck! :)
Yes, have a look at the following example:
It creates a little red circle. You can move it around with entering w, a, s or d into the console.