format type python type ' ' ' 'pfloat double char[char['pvoid float float string string with length encoded in the first byte integer each format character can be preceded by an integer to indicate repeat count (for example' iis the same as 'iiii'for the 'sformatthe count represents the maximum length of the stringso ' srepresents -byte string format of ' sindicates string of zero length the 'pformat is used to encode string in which the length appears in the first bytefollowed by the string data this is useful when dealing with pascal codeas is sometimes necessary on the macintosh note that the length of the string in this case is limited to characters when the 'iand 'lformats are used to unpack valuethe return value is python long integer in additionthe 'pformat may return an integer or long integerdepending on the word size of the machine the first character of each format string can also specify byte ordering and alignment of the packed dataas shown hereformat byte order size and alignment '@'='<'>'!native native little-endian big-endian network (big-endiannative standard standard standard standard native byte ordering may be little-endian or big-endiandepending on the machine architecture the native sizes and alignment correspond to the values used by the compiler and are implementation-specific the standard alignment assumes that no alignment is needed for any type the standard size assumes that short is bytesint is byteslong is bytesfloat is bitsand double is bits the 'pformat can only use native byte ordering notes sometimes it' necessary to align the end of structure to the alignment requirements of particular type to do thisend the structure-format string with the code for that type with repeat count of zero for examplethe format 'llh lspecifies structure that ends on -byte boundary (assuming that longs are aligned on -byte boundariesin this casetwo pad bytes would be inserted after the short value specified by the 'hcode this only works when native size and alignment are being used--standard size and alignment don' enforce alignment rules the 'qand 'qformats are only available in "nativemode if the compiler used to build python supports the long long data type lib fl ff