OS : Linux Mint19 xfce
wxPyhtonは、高機能なpython3のGUIだ。
python 2 で使用していたが、python 3 では一時期対応していなかったが、現在では使用可能となっている。
標準のtkinterと比べて、機能面で優れているようだ。
Python3-wxgtk4.0 をインストールすると
import wx
でエラーが出力されない。
OS : Linux Mint19 xfce
wxPyhtonは、高機能なpython3のGUIだ。
python 2 で使用していたが、python 3 では一時期対応していなかったが、現在では使用可能となっている。
標準のtkinterと比べて、機能面で優れているようだ。
Python3-wxgtk4.0 をインストールすると
import wx
でエラーが出力されない。
import tkinter as tk
class Frame(tk.Frame):
"""フレーム設定"""
def __init__(self, master=None):
tk.Frame.__init__(self, master)
""" 初期化 """
self.master.geometry('300x200')
self.master.bind('< KeyPress >', self.key)
def key(self, event):
print ("key code", repr(event.char))
if __name__ == '__main__':
root = Frame()
root.mainloop()
押されたキーのコードやキー名が表示される