From: Sting <sti...@gm...> - 2008-03-05 03:02:12
|
Hi, I got a very strange result when use struct.pack(). Please see the following code segment: import struct dataunits = struct.pack('!HHIIIBBHQ', 0x20, 0x1c, 0xffffffff, 0x00000000, 0x0233, 0x05, 0x00, 0x0000, 0x1234) print len(dataunits) dataunits = struct.pack('!HHIIIBBH', 0x20, 0x1c, 0xffffffff, 0x00000000, 0x0233, 0x05, 0x00, 0x0000) print len(dataunits) s = struct.pack('!Q', 0x1234) print len(s) In jython, the result is: 32, 20, 8 while in python, the result is: 28, 20, 8. Is it a bug? -- Best regards! -Sting |