Reputation: 21
I need print hex value of '?' this character
currently, my script returns wierd characters such as '?' or '£☻ §"
I want to read them as proper hex value.
if choice == 8:
incoming =ser.readline()
print incoming
Can anyone please help me with this?
Upvotes: 0
Views: 1585
Reputation: 2653
Take a look at this post: Print a string as hex bytes?
You ultimately need to encode each character as it's raw hex byte using c.encode('hex')
where c
is a character in your string.
Upvotes: 1