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...
import tkinter as tk root = tk.Tk() screen_width = root.winfo_screenwidth() screen_height = root.winfo_screenheight()
A possible solution
import os os.system("xrandr | grep \* | cut -d' ' -f4")
My output:
1440x900 0
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With