If I have :
my_str = \'0xfe\' str_enc = my_str.encode() >> str_enc b\'0xfe\' >>type(str_enc) a_lst = [my_str] byte_arr = byte