ich möchte mit tkinter eine gui schreiben und habe gerade folgendes Problem.
Code: Alles auswählen
import tkinter as tk
root = tk.Tk()
canvas = tk.Canvas(root, height=700, width=700, bg="blue").pack()
frame = tk.Frame(root, bg="white")
frame.place(relwidt=0.8, relheight=0.8, relx=0.1, rely=0.1)
hello = tk.Button(root, text="test", padx=100, pady=5, ).pack()
hello.grid(row=2, column=2)
root.mainloop()
Code: Alles auswählen
hello.grid(row=2, column=2)
AttributeError: 'NoneType' object has no attribute 'grid'
Wieso nicht? hello ist doch eine Instanz von Button oder sehe ich das flasch?]