基本です。.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が出力されます。
これから、tkinterを使ってアプリケーションを作るのに必要なことを 少しづつ説明していくつもりです。 今回は、そのときに必要な基本的な考え方を説明します。 画面がどのように作られているのか。 ボタンなどを押したとき、どの用に動作しているのか ...
「Tkinter」というGUIライブラリを利用することで、PythonでもデスクトップのGUIアプリを作成できる。その方法を解説しよう。 最初に、すべての基本となる「1枚のウインドウを表示するだけのアプリ」をPython+Tkinterで作りましょう。プログラム(ソースコード ...
先日、Windows 10標準の電卓アプリがオープンソースで公開されて話題となった。筆者も気になってソースコードを覗いてみた。電卓は実用的なアプリである上に、それほど難しいわけではないので、実際に作ってみると、プログラミング技術のレベルアップに ...
Tkinter is a lightweight, portable, and easy-to-use graphical toolkit available in the Python Standard Library, widely used to build Python GUIs due to its simplicity and availability. This book ...
Tkinter is widely used to build GUIs in Python due to its simplicity. In this book, you’ll discover Tkinter’s strengths and overcome its challenges as you learn to develop fully featured GUI ...
In this tutorial, we’ll explore how to create and customize a Tkinter window in Python. You’ll learn how to change the window’s title, resize it, set transparency, modify the stacking order, and even ...
一部の結果でアクセス不可の可能性があるため、非表示になっています。
アクセス不可の結果を表示する