I am attempting to move a character using the "asdw" keys in a game, but I cannot find a way to constantly input data without pressing return. I have seen that on windows there is a module called msvcrt, which has a getch function, so I am wondering if there is a way to simulate this in OSX, or more simply to just constantly input data from the keyboard.
相关问题
- Django __str__ returned non-string (type NoneType)
- How to postpone/defer the evaluation of f-strings?
- ImportError shows up with py.test, but not when ru
- Comparing pd.Series and getting, what appears to b
- Django Attribute error 'datetime.timedelta'
相关文章
- 放在input的text下文本一直出现一个/(即使还没输入任何值)是什么情况
- Airflow depends_on_past explanation
- Raspberry Pi-Python: Install Pandas on Python 3.5.
- Numpy array to TFrecord
- Show a different value from an input that what wil
- How to split a DataFrame in pandas in predefined p
- Accessing an array element when returning from a f
- Error following env.render() for OpenAI
Try the
curses
library:Curses is a library for controlling the terminal, and includes features such as drawing box shapes as well. It's available on any POSIX-compatible system, which includes Mac OS X and GNU/Linux.
Here's an example: