What argument should I be passing to "root" when importing a tkinter file? What argument should I be passing to "root" when importing a tkinter file? tkinter tkinter

What argument should I be passing to "root" when importing a tkinter file?


When written in modular manner it doesn't really matter which script drives the other. I personally prefer to make the GUI import other scripts.

If we were to assume that the first code snippet is indented correctly, and that it is somewhat the entire script, then the error is only natural because root by itself has no meaning. One must first assign an object to it for it to have a meaning.

By looking at your create_New_Toplevel, it looks like you should be passing an instance of tkinter.Tk class. Replace 'main' with:

if __name__ == "__main__":    import tkinter # replace with Tkinter if python 2.x    SNinput.create_New_Toplevel(tkinter.Tk())unittest.main()