【问题标题】:getKey from Ti-Basic in Python?Python中Ti-Basic的getKey?
【发布时间】:2014-10-21 11:03:07
【问题描述】:

我想知道 getKey 命令是如何工作的以及如何在 Python 中使用它,因为没有这样的命令(对吗?)。

不知何故,StackOverflow 不喜欢简短的问题。我在我的计算器上写​​了一个程序,然后我想,为什么不用 Python 把它放到我的电脑上呢?但后来我意识到我不能,因为我不知道如何处理 getKey。

【问题讨论】:

    标签: python input ti-basic


    【解决方案1】:

    不确定你的问题,但这是 Ti-Basic 中 getKey 命令的使用:

    :While 1         #loop
    :Repeat X        #make sure a key is presssed
    :getKey→X        #store that key in a variable
    :End             #end loop
    :Disp X
    :End
    

    getKey 返回一个值,该值对应于 Ti-“键盘”上的一个键。您可以在下图中查找键值。

    要在 Python 中获得此功能,请搜索此站点。您可以为此使用.char.keysym。更多信息:

    Keypress detection Python

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-04-09
      • 2023-03-17
      相关资源
      最近更新 更多