you are trying to use grid and pack on the same frame (mainframe) that's a no no.
Remove either the grid or the pack.
One but not both.
Also, change the def for mainwindow to:
Remove either the grid or the pack.
One but not both.
Also, change the def for mainwindow to:
def MainWindow(creds) # and then call like: MainWindow('tempfile.temp')also it's better to use naming like main_window (PEP8) rather than camel case