how to get screen width and height in python code example
Example 1: screen size tkinter
import tkinter as tk
root = tk.Tk()
screen_width = root.winfo_screenwidth()
screen_height = root.winfo_screenheight()
Example 2: get screen size python
>>> import pyautogui
>>> width, height= pyautogui.size()
>>> print(width)
1366
>>> print(height)
768
Example 3: get size of window tkinter
# Where w is a widget:
w.winfo_height()
w.winfo_width()