Module question

Kent Johnson kent at kentsjohnson.com
Tue Feb 21 17:44:32 EST 2006


Tuvas wrote:
> I know this is probably a very simple question, but I am building a
> program that is now at about 2400 lines of code in the main module. I
> need to break it up, however, there are certain variables that I would
> like to use among all of them, namely the TKinter background. It's
> build using tkinter, so, to do anything useful requires having the
> master=Tk() variable portable in every interface. I can't just pass
> this variable, the real way to do it is to have a global variable. How
> can I do this? Thanks!

You don't say what the program does, but try to identify code that does 
the actual work and put it in separate modules that implement a data 
model or business logic for the program. These modules should be 
independent of Tkinter.

Kent



More information about the Python-list mailing list