'How do I get a window's current size using Tkinter?

How do I get a windows current size using Tkinter, or possibly with the python standard library?



Solution 1:[1]

Use the following universal widget methods (where w is a widget):

w.winfo_height()
w.winfo_width()

You can also use the following:

w.winfo_reqheight()
w.winfo_reqwidth()

Read about Universal widget methods.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 martineau