I'm not sure what this type of byte array format is called in python:
Format A:
[8, 200, 1, 16, 200, 1, 24, 200, 1, 34, 21, 8, 1, 18, 17, 98, 97, 116, 116, 108, 101, 95, 116, 97]
but I'd like to convert it into this format (the name of which I’m also unsure of):
Format B:
b'\x08\xc8\x01\x10\xc8\x01\x18\xc8\x01"\x15\x08\x01\x12'
I know how to get from Format B to Format A:
import array
data =b'\x08\xc8\x01\x10\xc8'
print array.array('B', data))
but I'm unsure of how to get from Format A to Format B, and because I also don't know the names of either format, the google results I've gotten have been sparse.