I want to take an integer (that will be <= 255), to a hex string representation
e.g.: I want to pass in 65 and get out \'\\x41\', or
65
\'\\x41\'
What about hex()?
hex(255) # 0xff
If you really want to have \ in front you can do:
\
print '\\' + hex(255)[1:]