python初心者です。
教本を使用して勉強しております。
tkinterを使用してのプログラムを実行したところ、見たことのないerrorがでました。
自分ではコードの問題はないように思いましたので、ActiveTclなどをインストールしなおしたのですがやはり無理でした。
どうかご教授お願いいたします。
下記のように定義しております。
from tkinter import * def count_text(event): s = main_text.get(1.0, END) info_label.config(text="{0}文字".format(len(s))) root = Tk() root.title('テキストカウンタ') main_text = Text(root) main_text.bind("<key>", count_text) main_text.pack() info_label = Label(root) info_label.pack() root.main() ```ここに言語を入力 ```ここに言語を入力 Traceback (most recent call last): File "text-counter.py", line 11, in <module> main_text.bind("<key>", count_text) _tkinter.TclError: bad event type or keysym "key"

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/11/21 09:26