tags:

views:

98

answers:

2

hello there i wanted to know if it was possible to calculate the screen size of the user via python this way i can make the program open up in the center of the screen because my tkinter window resize needs to know what coordinates (x and Y) to start the window on

Thanks a lot

+4  A: 
import Tkinter

root = Tkinter.Tk()

screen_width = root.winfo_screenwidth()
screen_height = root.winfo_screenheight() 
singularity
These two are also universal widget methods.
martineau
+1  A: 

A possible solution

import os

os.system("xrandr  | grep \* | cut -d' ' -f4")

My output:

1440x900
0
Nandit Tiku