Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
convert result to hex ascii
#3
(May-19-2023, 11:03 AM)deanhystad Wrote: Use int() to convert numeric strings to int objects.
print(int("0x3846", 16)) (str, base)
Output:
14406
Python does not 16 bit (or any fixed number of bits) ints, so signed/unsigned is not a thing in Python.

Thanks but my source is your result
Source: 13889
Result ASCII hex code: 6A = ASCII 6 as 0x36 and A as 0x41

The first step is convert 13889 to 0x3641 and then to ASCII string 6A and finally swap string result to A6
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,744 Aug-02-2022, 01:12 PM
Last Post: deanhystad
  convert hex encoded string to ASCII Skaperen 4 114,727 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