0
私は現在、学校プロジェクト用のアドレス帳のGUIを作成しようとしています。現時点では私はGUIに私の検証をリンクしますが、このエラーメッセージが出続けるしようとしています:_tkinter.TclError:不明なオプション
Traceback (most recent call last):
File "C:\Users\katie_000\Downloads\GUI adresses practice (1).py", line 198, in <module>
B = Button(window, width=46, text = "Add",fg="gray16", command=name())
File "C:\Users\katie_000\Downloads\GUI adresses practice (1).py", line 8, in name
Sname()
File "C:\Users\katie_000\Downloads\GUI adresses practice (1).py", line 17, in Sname
Hphone()
File "C:\Users\katie_000\Downloads\GUI adresses practice (1).py", line 24, in Hphone
label.configure("You must enter a phone number")
File "C:\Users\katie_000\AppData\Local\Programs\Python\Python36 \lib\tkinter\__init__.py", line 1479, in configure
return self._configure('configure', cnf, kw)
File "C:\Users\katie_000\AppData\Local\Programs\Python\Python36 \lib\tkinter\__init__.py", line 1469, in _configure
return self._getconfigure1(_flatten((self._w, cmd, '-'+cnf)))
File "C:\Users\katie_000\AppData\Local\Programs\Python\Python36\lib\tkinter\__init__.py", line 1457, in _getconfigure1
x = self.tk.splitlist(self.tk.call(*args))
_tkinter.TclError: unknown option "-You must enter a phone number"
誰かがこれが何を意味するのか私に言うことができれば、私はそのすべての情報を見つけることができないとしてそれは、素晴らしいことです私に役立ちます。 label.configure("You must enter a phone number")
を使用して
多くのおかげ
トレースバックだけでなく、関連するコードも表示する必要があります。 – mentalita
しかし、トレースバックからは、そのようなラベルを設定しないと言えます。テキストを設定する場合は、そのようにパラメータを指定する必要があります。 'label.configure(text = 'する必要があります...')'。 'command = name()'にも括弧は必要ありません。 – mentalita