tkinter auto size code example
Example: tkinter auto resize height
masterWindow.geometry("%dx%d" % (self.window_width, self.window_height))
or
masterWindow.geometry("")
masterWindow.geometry("%dx%d" % (self.window_width, self.window_height))
or
masterWindow.geometry("")