import struct dataunits = struct.pack('!HQ', 0, 0) print len(dataunits) dataunits = struct.pack('!Q', 0) print len(dataunits)