Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
convert result to hex ascii
#4
n=13889
print(bytes.fromhex(f'{n:02X}').decode())
print(bytes.fromhex(f'{n:02X}').decode()[::-1])
Output:
6A A6
Jusufs likes this post
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs

Reply


Messages In This Thread
convert result to hex ascii - by Jusufs - May-19-2023, 10:43 AM
RE: convert result to hex ascii - by deanhystad - May-19-2023, 11:03 AM
RE: convert result to hex ascii - by Jusufs - May-19-2023, 11:20 AM
RE: convert result to hex ascii - by buran - May-19-2023, 11:28 AM
RE: convert result to hex ascii - by Jusufs - May-19-2023, 11:31 AM
RE: convert result to hex ascii - by deanhystad - May-19-2023, 11:30 AM
RE: convert result to hex ascii - by deanhystad - May-19-2023, 03:21 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Convert SQLite Fetchone() Result to float for Math Extra 13 3,747 Aug-02-2022, 01:12 PM
Last Post: deanhystad
  convert hex encoded string to ASCII Skaperen 4 114,733 Oct-02-2016, 09:22 AM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020