1# READ THE COMMENTS!
2
3<window name>.overrideredirect(1) # Replace "<window name>" with the name of your window
4
5w = * # width for the Tk root (Replace The * With The Width Of Your Window)
6h = * # height for the Tk root (Replace The * With The Height Of Your Window)
7
8# get screen width and height
9ws = <window name>.winfo_screenwidth() # width of the screen (Replace "<window name>" with the name of your window)
10hs = <window name>.winfo_screenheight() # height of the screen (Replace "<window name>" with the name of your window)
11
12# calculate x and y coordinates for the Tk root window
13x = (ws/2) - (w/2)
14y = (hs/2) - (h/2)
15
16# set the dimensions of the screen
17# and where it is placed
18<window name>.geometry('%dx%d+%d+%d' % (w, h, x, y)) # Replace "<window name>" with the name of your window