【问题标题】:Key released in Python?在 Python 中发布的密钥?
【发布时间】:2017-09-13 17:30:21
【问题描述】:

我目前正在用 python 编写秒表。在此,我希望在松开回车键后触发启动。我该怎么做?

【问题讨论】:

    标签: python keyboard keyboard-events


    【解决方案1】:

    我不认为你可以通过简单地释放回车键来触发事件

    你可以这样做(在 python 2.7 版本中)

    import time
    click1 = raw_input("Click Enter to start")
    start = time.time()
    click2 = raw_input("Click Enter to stop")
    print time.time() - start
    

    希望对您有所帮助!

    【讨论】:

      猜你喜欢
      • 2020-02-17
      • 2014-04-11
      • 1970-01-01
      • 2014-03-19
      • 2020-05-06
      • 2018-11-28
      • 1970-01-01
      • 2011-10-14
      • 1970-01-01
      相关资源
      最近更新 更多