A string of Python code?

Which means 8s8I4s in the code below ? what are these numbers ?

# footer
 FOOTER = '8s8I4s'
 FOOTER_SIZE = struct.calcsize(FOOTER)

 if file_size < FOOTER_SIZE:
 raise ValueError('Input file size is too small: %d' % file_size)

 f.seek(-FOOTER_SIZE, os.SEEK_END)
 data = f.read(FOOTER_SIZE)
 reserved, meta_data_crc32, meta_data_size, info_crc32, num_files, names_size_compressed, names_size_original, files_table_size, files_table_crc32, marker = struct.unpack(FOOTER, data)

 if marker != DVPK_MARKER:
 raise ValueError('Input file footer marker is invalid: %s' % binascii.hexlify(marker))
March 19th 20 at 09:23
2 answers
March 19th 20 at 09:25
Some string signature
Thanks, I can get more? - Hortense commented on March 19th 20 at 09:28
March 19th 20 at 09:27
https://docs.python.org/3/library/struct.html#form...

In [24]: struct.pack('8s8I4s', b stroka12', 1, 2, 3, 4, 5, 6, 7, 8, b eshe') 
Out[24]: b'stroka12\x01\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x00\x04\x00\x00\x00\x05\x00\x00\x00\x06\x00\x00\x00\x07\x00\x00\x00\x08\x00\x00\x00eshe'


In [26]: x = struct.pack('8s8I4s', b stroka12', 1, 2, 3, 4, 5, 6, 7, 8, b eshe') 

In [27]: struct.unpack('8s8I4s', x) 
Out[27]: (b stroka12', 1, 2, 3, 4, 5, 6, 7, 8, b eshe')
What this line does and where you get it ? - Hortense commented on March 19th 20 at 09:30
@Hortense, read the documentation at least, not shame - Estrella39 commented on March 19th 20 at 09:33

Find more questions by tags Python