how do I pass values between classes?
Max Erickson
maxerickson at gmail.com
Mon Nov 6 10:35:22 EST 2006
"kath" <nitte.sudhir at gmail.com> wrote:
> hi, Larry Bates .... thanks for the reply...
>
>> You might consider doing it the same way wx passes things around.
>> When you instantiate the subclass pass the parent class' instance
>> as first argument to __init__ method.
>
> Yes thats absolutely right..
>
>> That way the subclass can
>> easily pass values back to the parent by using that pointer.
>
> Could you please explain me this.. more clearly. I think it is much
> close to the solution.
>
>
> Thank you.
> regards, sudhir
>
Somewhere in the child class:
self.parent.do_something(something_to_do_it_with)
More information about the Python-list
mailing list