Error in if h < size[1]: # shrink the window vertically if it doesn't fit
size[1] = h - 10
y = 0
Fix : # Convertir le tuple en liste pour permettre la modification
size = list(size)
margins = (h-height) / 2
if margins < 100: # Don't waste any vertical space on smaller screens,
y = 0 # push the window right up to the top.
elif margins < 200:
y = 50 # window is partial way down, but not into the bottom 100px>
else:
y = h/2 - size[0]/2 # big screen - center vertically
if h < size[1]: # shrink the window vertically if it doesn't fit
size[1] = h - 10
y = 0
and on line 235 , remplace self.master.geometry("%dx%d+%d+%d" % (size + (x, y))) by self.master.geometry("%dx%d+%d+%d" % (tuple(size) + (x, y)))
Error in if h < size[1]: # shrink the window vertically if it doesn't fit
size[1] = h - 10
y = 0
Fix : # Convertir le tuple en liste pour permettre la modification
size = list(size)
and on line 235 , remplace self.master.geometry("%dx%d+%d+%d" % (size + (x, y))) by self.master.geometry("%dx%d+%d+%d" % (tuple(size) + (x, y)))