[Chicago] create all classes

Lukasz Szybalski szybalski at gmail.com
Fri Feb 1 17:26:58 CET 2008

I just converted big txt file definition to classes in .py file.

There are around 30 classes in the file. How can I iterate through
that file and initiate each class to some object in a list?


class MSG_CTRL_BLK(object):
    def __init__(self):
        self.GMSLOC=Element(self.block,'GLOC','MESSAGE HEADER','AN',26, 1)

so instead of typing :
30 times

I want:
Outside of the file I would like to :
import blocks
for i in blocks.xx???Xx:
    myblocks.append( i() )

what would be the function to get me list of classes?
How can I iterate and create them on a fly.


More information about the Chicago mailing list