A
A
Alex Moon2018-03-11 13:39:02
Python
Alex Moon, 2018-03-11 13:39:02

Strcut python 3, unpack how to unpack frames?

there is a code like this -

def get_mac_addr(bytes_addr):
  bytes_str = map('{:02x}'.format, bytes_addr)
  return = ':'.join().upper()

and such a condition: how does it work? and what are these! 6s 6s H?
struct.unpack('! 6s 6s H', data[0:14])

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
Fadi Haj, 2018-03-31
@fdhaj

These characters are specifiers.
They are described in the documentation: 7.1.2.2. Format Characters .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question