I am making a stopwatch type program in Python and I would like to know how to detect if a key is pressed (such as p for pause and s for stop), and I would not like it to be something like raw_input
, which waits for the user's input before continuing execution.
Anyone know how to do this in a while loop?
I would like to make this cross-platform but, if that is not possible, then my main development target is Linux.
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…