Must function defs appear earlier than calls?

SeeBelow at SeeBelow.Nut SeeBelow at SeeBelow.Nut
Tue May 4 12:29:42 EDT 2004


Eric Brunel wrote:
<snip>
> Also note that you have no need to pack objects just after creating them. You
> can just do:
> 
> def stuff(master):
>    scale1 = Scale(master)
>    scale2 = Scale(master)
>    def init_classes(scales=[scale1, scale2]):
>      ... stuff ...
>    button = Button(master, command=init_classes)
>    button.pack()
>    scale1.pack()
>    scale2.pack()

Thank You, that's what I was looking for.  If I can define the scales
early and pack them later, that solves my problem.

m

-- 
"Many are stubborn in pursuit of the path they have chosen, few in
pursuit of the goal." - Friedrich Nietzsche

http://annevolve.sourceforge.net is what I'm into nowadays.
Humans may write to me at this address: zenguy at shaw dot ca



More information about the Python-list mailing list