I'm struggling myself to replicate the below statement from Perl to Python but I'm not really sure how to perform using the python struct module.
So the code that I need to convert is:
my $hex_string = "DEADBEEF";
my @bytes = map( hex, unpack("(A2)*", $hex_string ) );
The above is equivalent to
my @bytes = ( 0xDE, 0xAD, 0xBE, 0xEF );
A2
doesn't seems to be a good option for Python struct. Can anyone help me with this?