Alex Rivera | Logout

How can I get the screen size in Tkinter?

Asked 2010-10-16T17:02:02.613
47

I would like to know if it is possible to calculate the screen size using Tkinter.

I wanted this so that can make the program open up in the center of the screen...

Edit
Report

1 Answer

110
import tkinter as tk

root = tk.Tk()

screen_width = root.winfo_screenwidth()
screen_height = root.winfo_screenheight()
answered 2010-10-16T17:33:27.060

Your Answer