Project Overview This is a desktop application built with Python and Tkinter that tests your typing speed. The application measures how quickly and accurately you can type a given text passage, then ...
ラズパイはミニPCの一つですが、WindowsなどのOSと趣旨が違いより外部機器とやり取りしやすい構造になっています。例えばカメラモジュールは取り付けてちょっと初期設定をすれば、Python等から比較的簡単に操作できます。 ところで、外部機器とやり取り ...
基本です。.bindでkeyが打たれたときの状態を感知することができます。 import tkinter as tk root = tk.Tk() def key_event(e): print(e.keysym) root.bind("<KeyPress>", key_event) root.mainloop() このコードを実行してキーボードを叩けばprint関数で打ったkeyが出力されます。