Say that I have a 4 character string, and I want to convert this string into a byte array where each character in the string is translated into its hex equivalent. e.g.
for python 3 it worked for what @HYRY posted. I needed it for a returned data in a dbus.array. This is the only way it worked
s = "ABCD"
from array import array
a = array("B", s)