In Python, I'm constantly using the following sequence to get an integer value from a byte buffer (in python this is a str).
I'm getting the buffer from the struct.unpack() routine. When I unpack a 'char' using
byte_buffer, = struct.unpack('c', raw_buffer)
int_value = int( byte_buffer.encode('hex'), 16 )
Is there a better way?