Unbuffered character input for python on a windows machine

后端 未结 2 780
轮回少年
轮回少年 2021-01-15 14:45

What I am trying to do

I am trying to design a stopwatch with lap timing. When you press \"L\" then a lap is completed and when you press \"S\" all

2条回答
  •  借酒劲吻你
    2021-01-15 15:11

    If you are asking about how to read input without input, you probably are looking for binding This requires a Tkinter window, I believe.

    lapEnded = bind_all("", endLap)
    stopRunning = bind_all("

    Then, you define the functions endLap and noMoreRunning, which do their functions. Depending on your version of Tkinter and/or Python, bind_all may simply be bind. Hope this answers your question.

提交回复
热议问题