Is there a more elegant way to do this?

Kamilche klachemin at home.com
Sat Jun 26 17:58:32 EDT 2004


'''
Is there a more elegant way of doing this?
I would like to have the arguments to pack
automatically taken from lst.
'''

    def pack(self):
        lst = ['id', 'parent', 'number', 'x', 'y', 'z', 'red', \
                   'green', 'blue', 'size', 'rotate', 'translucency']
        return struct.pack('<IIIiiiBBBHHH', \
                           self.id, self.parent, self.number,   \
                           self.x, self.y, self.z,  \
                           self.red, self.green, self.blue, \
                           self.size, self.rotate, self.translucency)



More information about the Python-list mailing list