python3.6.5においてpythonの公式ドキュメントの下記のコードを実行したところ下記のエラーが
でました。解決方法を教えて頂きたいです。
<コード>
import tkinter as tk
class Application(tk.Frame):
def init(self, master=None):
super().init(master)
self.pack()
self.create_widgets()
def create_widgets(self): self.hi_there = tk.Button(self) self.hi_there["text"] = "Hello World\n(click me)" self.hi_there["command"] = self.say_hi self.hi_there.pack(side="top") self.quit = tk.Button(self, text="QUIT", fg="red", command=root.destroy) self.quit.pack(side="bottom") def say_hi(self): print("hi there, everyone!")
root = tk.Tk()
app = Application(master=root)
app.mainloop()
<エラー>
File "C:\Users\ymdky\tkinter.py", line 3, in <module>
class Application(tk.Frame):
AttributeError: module 'tkinter' has no attribute 'Frame'
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
退会済みユーザー
2018/09/29 00:11