Python 3 Tkinter Get Desktop OS Monitor Screen Resolution (Width and Height) of Canvas Window Full Tutorial For Beginners

 

 

main.py

 

 

import tkinter as tk

root = tk.Tk()

screen_width = root.winfo_screenwidth()
screen_height = root.winfo_screenheight()

print(screen_width)
print(screen_height)

root.mainloop()

Leave a Reply