Python method for reading keypress?

I’m new to Python, and I just made a game and a menu in Python.
Question is, that using (raw_)input() requires me to press enter after every keypress, I’d like to make it so that pressing down-arrow will instantly select the next menu item, or move down in the game. At the moment, it requires me to like type “down” and then hit enter. I also did quite a lot of research, but I would prefer not to download huge modules (e.g. pygame) just to achieve a single keyDown() method. So are there any easier ways, which I just couldn’t find?

How to determine if object is a valid key-value pair in PySpark

If I have a rdd, how do I understand the data is in key:value format? is there a way to find the same – something like type(object) tells me an object’s type. I tried print type(rdd.take(1)), but it just says <type ‘list’>. Let’s say I have a data like (x,1),(x,2),(y,1),(y,3) and I use groupByKey and … Read more