tkinter center window

    def center_window(self, cont, width, height):
        screenwidth = cont.winfo_screenwidth()
        screenheight = cont.winfo_screenheight()
        size = "%sx%s+%s+%s" % (
            width, height, (screenwidth - width) / 2,
            (screenheight - height) / 2)
        return size
原文地址:https://www.cnblogs.com/otfsenter/p/6598343.html