[tkinter] trouble running imported modules in main program

snakeinmyboot mikelhamer at gmail.com
Wed Aug 7 00:26:57 EDT 2013


> Make the boilerplate test code conditional, something like
>
>
>
> if __name__ == '__main__':
>
>      root = tkinter.Tk()
>
>      app = MainClass(root)  # 'MainClass' depends on the module.
>
>      root.mainloop
>
>      root.destroy
>
>
>


Could you elaborate on this a little bit? Never even heard the term "boilerplate test code".
Also, I have removed the mainloops from the other modules, but this didnt seem to affect anything.
Thanks for the reply! (the message I sent you was supposed to be this reply, my bad)



More information about the Python-list mailing list