20

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

martineau
  • 119,623
  • 25
  • 170
  • 301
rectangletangle
  • 50,393
  • 94
  • 205
  • 275

1 Answers1

33

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
  • 119,623
  • 25
  • 170
  • 301
Gary Kerr
  • 13,650
  • 4
  • 48
  • 51