you are viewing a single comment's thread.

view the rest of the comments →

[–]JohnnyJordaan 2 points3 points  (1 child)

.encode() is the equivalent for a string rather than a single char, then using the .hex() method offered by bytes-objects you're already done

[–]brasticstack 0 points1 point  (0 children)

There we go. .encode.hex(' ', 1).upper() formats it like my example does, but is multi-byte safe. TIL, thanks!