Class functions

Chad Maine chad.maine at broadlink.com
Tue Feb 26 16:15:25 EST 2002


I'd like to access the data updated in real time via a class' function.
I've got something like this:

the class:

def CLASS:
    def __init__...

    def __del__...

    def FUNC(self):
        while 1:
            self.DATA = StringIO.StringIO(UPDATE)
            if self.DATA == '': break
        self.DATA.close()

in my client script:

import theclass
X = theclass.CLASS
X.FUNC()
while 1:
    try:
        DATA = self.DATA
        if not DATA: break
        print DATA.read()
    except ValueError:
        break






More information about the Python-list mailing list