Last active
June 3, 2024 00:01
-
-
Save FyeCobain/a21564aad4b3d4fe458f8e249dbcc43b to your computer and use it in GitHub Desktop.
Python: Center Tkinter root
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
width, height, rise = 300, 250, 70 | |
x, y = root.winfo_screenwidth()/2-width/2, root.winfo_screenheight()/2-height/2-rise | |
root.geometry('%dx%d+%d+%d' % (width, height, x, y)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment