i have a script which should interact with the users input (pressing the arrow keys), but i cannot get the keys. i tried raw_input and some other functions, but they didnt work. this is my sample code, how it should look like (running bool can be set to False in another function)
running = True
while running:
#if input == Arrow_UP:
# do_Sth
#elif ...
display()
time.sleep(1)
another question is, how can i call the display function only once every second, but react on the input immediately?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…