Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
int to hex
#3
Thank you for the quick reply, Larz.
The number conversion between int,hex etc seems ok. Int 3360 becomes hex 0xd20. How would you convert it to b'\x0d\x20' ? When running struct it just becomes b' \r'

#print(struct.pack("<H", 3360))
Output:
b' \r'
Reply


Messages In This Thread
int to hex - by pythonper - Mar-12-2018, 09:30 AM
RE: int to hex - by Larz60+ - Mar-12-2018, 10:03 AM
RE: int to hex - by pythonper - Mar-14-2018, 08:49 AM
RE: int to hex - by Larz60+ - Mar-14-2018, 12:24 PM

Forum Jump:

User Panel Messages

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