Tkinter provides some methods with the help of which we can get the current screen height and width.
Following methods can be used to decide height and width :
winfo_screenheight() // Returns screen height in pixels winfo_screenmmheight() // Returns screen height in mm winfo_screenwidht() // Returns screen width in pixels winfo_screenmmwidth() // Returns screen width in mm
Code #1: Getting height and width in pixels.
Code #2: Getting height and width in mm.
- PyQt5 QCalendarWidget - Getting Height for width
- PyQt5 – Set fix window size for height or width
- PyQt5 QSpinBox - How to get the preferred height for the given width
- PyQt5 QSpinBox - Checking if height depend on the width
- PyQt5 – Set maximum size for width or height of window
- PyQt5 – Set minimum length for width/height of Status Bar
- PyQt5 QCalendarWidget - Checking if height is preferable to the width
- PyQt5 - Set fixed length for width/height of Status Bar
- Python GUI - tkinter
- Different messages in Tkinter | Python
- Python | after method in Tkinter
- Python Tkinter - Message
- Python: Age Calculator using Tkinter
- Python Tkinter - SpinBox
- Python | GUI Calendar using Tkinter
- Python-Tkinter Scrollbar
- Python Tkinter - Label
- RadioButton in Tkinter | Python
- Python Tkinter Tutorial
- Python | Add style to tkinter button
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.