madpython wrote:
> ...
> self.b=Tkinter.Button(root,txt="Button",command=self.doSmth).pack()
> self.l=Tkinter.Label(root,txt="default").pack()
> def doSmth(self):
> var=globals()["m"].__dict__["progLogic"].func("some
> input")
> self.l.config(txt=var)
> self.l.update_
Thank you all for your comments. They are priceless beyond any doubt.
As for the matter of the discussion it took me only a minute looking at
the code to realize that with Tkinter I pass "master" reference to
every widget and therefore I can access every method in the class
hierarchy. I'm a fool th
madpython wrote:
> Here is a short illustration:
>
> ...
> self.b=Tkinter.Button(root,txt="Button",command=self.doSmth).pack()
> self.l=Tkinter.Label(root,txt="default").pack()
> def doSmth(self):
> var=globals()["m"].__dict__["progLogic"].func("some
> input")
> self.l.con
"madpython" <[EMAIL PROTECTED]> wrote:
>I've been doing an application with Tkinter widgets. Nothing really
>fancy just routine stuff. Though I have no problems with it by now I
>guess it would be reasonable to ask about a thing that's been bothering
>me a bit. Look at this piece of code:
>
>class
madpython a écrit :
> Marc 'BlackJack' Rintsch wrote:
>
>>In <[EMAIL PROTECTED]>, madpython
>>wrote:
>>
>>
>>No it's not the normal way. Why don't you give `c` as argument to the
>>`interClassCall()`?
>>
>>class B(object):
>>def interClassCall(self, c):
>>print c.a.a()
>>
>>class C(ob
Marc 'BlackJack' Rintsch wrote:
> In <[EMAIL PROTECTED]>, madpython
> wrote:
>
>
> No it's not the normal way. Why don't you give `c` as argument to the
> `interClassCall()`?
>
> class B(object):
> def interClassCall(self, c):
> print c.a.a()
>
> class C(object):
> def __init__(sel
madpython a écrit :
> I've been doing an application with Tkinter widgets. Nothing really
> fancy just routine stuff. Though I have no problems with it by now I
> guess it would be reasonable to ask about a thing that's been bothering
> me a bit. Look at this piece of code:
>
> class A(object):
>
In <[EMAIL PROTECTED]>, madpython
wrote:
> I've been doing an application with Tkinter widgets. Nothing really
> fancy just routine stuff. Though I have no problems with it by now I
> guess it would be reasonable to ask about a thing that's been bothering
> me a bit. Look at this piece of code:
>
madpython wrote:
> What is another way to get data from method of another instance of a
> class? Or maybe print globals()['c'].__dict__['a'].a() is perfectly
> normal.
I'd say it's a fireable offense.
--
http://mail.python.org/mailman/listinfo/python-list
I've been doing an application with Tkinter widgets. Nothing really
fancy just routine stuff. Though I have no problems with it by now I
guess it would be reasonable to ask about a thing that's been bothering
me a bit. Look at this piece of code:
class A(object):
def a(self):
return "a
10 matches
Mail list logo