0

I just have a short question about my rather simple Python Code. I wanted to create a GUI as you can see, but every time I use the built-in

.grid()

function, the GUI window does not open and I dont know why. Thank you for the answers

root = Tk()

root.title("Hello World")

label = Label(root, text="Label 1")
label2 = Label(root, text="Label 2")


b = Button(root, text="Hallo")
b1 = Button(root, text="o")
b2 = Button(root, text="k")
b3 = Button(root, text="w")
b4 = Button(root, text="e")
b5 = Button(root, text="l")
b6 = Button(root, text="t")
b7 = Button(root, text="d")
b8 = Button(root, text="u")


label.grid(row=0, column=0)
label2.grid(row=0, column=1)
b.pack()
b1.pack()
b2.pack()
b3.pack()
b4.pack()
b5.pack()
b6.pack()
b7.pack()


root.mainloop()
eyllanesc
  • 235,170
  • 19
  • 170
  • 241
HeLlOwOrLd
  • 49
  • 7

0 Answers0