Python Tkinter: Attempt to get widget size
You are trying to get the dimensions before the window has been rendered.
Add a root.update()
before the print
s and it shows the correct dimensions.
from Tkinter import *root=Tk()root.geometry('400x600')root.update()print (root.winfo_width())print (root.winfo_height())print (root.winfo_geometry())root.mainloop()