How do I get a windows current size using Tkinter, or possibly with the python standard library?
Asked
Active
Viewed 5.0k times
20
-
3duplicate : http://stackoverflow.com/questions/3949844/python-calculate-the-screen-size/3949983#3949983 – mouad Oct 31 '10 at 23:42
-
@mouad: **No**, not a dup of that. – martineau Apr 12 '22 at 18:45
1 Answers
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.
-
10be aware that those two can give drastically different results. _height/_width give the actual sizes. – Bryan Oakley Nov 01 '10 at 01:32