19

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

martineau
  • 112,593
  • 23
  • 157
  • 280
rectangletangle
  • 46,943
  • 90
  • 196
  • 270

1 Answers1

30

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.

martineau
  • 112,593
  • 23
  • 157
  • 280
Gary Kerr
  • 12,498
  • 4
  • 46
  • 50