Is there a more elegant way to do this?

Kamilche klachemin at home.com
Mon Jun 28 14:12:09 EDT 2004


Peter Hansen <peter at engcorp.com> wrote in message news:<OYydnadytZWWhn3dRVn-ug at powergate.ca>...

> def pack(self):
>      args = ('Iid Iparent Inumber ix iy iz Bred Bgreen Bblue '
>          'Hsize Hrotate Htranslucency')
>      lst = zip(*[(x[0],x[1:]) for x in s.split()])
>      return struct.pack('<' + ''.join(lst[0]),
>          *[getattr(self, n) for n in lst[1]])

You scary c-like-code-creator, you. :-O



More information about the Python-list mailing list