I've been learning Python from an e-book. Right now I am learning about the Tkinter
module
The book suggested running the following code. However, it does not work as it should. Any ideas why?
from Tkinter import *
window = Tk()
window.geometry("200x200")
my_frame = Frame()
my_frame.pack
button1 = Button(my_frame, text = "I am at (100x150)")
button1.place(x=100, y=150)
button2 = Button(my_frame, text = "I am at (0 x 0)")
button2.place(x=0, y=0, width=100, height=50)
window.mainloop()
What I should get:
What I get:
After adding button1.pack()
and button2.pack()
, I get this: