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

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

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

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()
Share on:

Hi, I'm Ranjith a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Diksha. Here, I post about programming to help developers.

Leave a Comment