[Tutor] Calling variable from two different classes

Hi haztang17 at gmail.com
Fri Feb 13 19:05:44 CET 2009


I want to be able to call a variable from one of my classes to my main class
(interface layout) and have it update every minute. I am using Python and
wxPython. Is it better to be in the main class and read the variable or
should I have the class the variable resides in to send the variable along
to the main class?  In my interface class I have it as:

display = wx.StaticText(self, -1, '', (50, 50))

while the class where the variable is in:

data_rate = 5000

and I want to be able to put the value stored in data_rate into display so
that I can show it on my interface. And regarding the update per some time,
I am looking into the poll command. Is that the direction where I should be
heading? (I know updating data_rate won't do anything right now since it's a
constant, but it will vary later on... just one step at a time here).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20090213/774138c8/attachment.htm>


More information about the Tutor mailing list