How to set the window location in the center of the screen?

    1 answer 1

    Something like this (one of Google's answers):

    from Tkinter import * root = Tk() x = (root.winfo_screenwidth() - root.winfo_reqwidth()) / 2 y = (root.winfo_screenheight() - root.winfo_reqheight()) / 2 root.wm_geometry("+%d+%d" % (x, y)) root.mainloop()