I have a python snippet like this:
siz=len(ret)
for i in range(0,siz-1):
print "%s " % ret[i],
When I use %s
it works fine and prints some alien characters on the console!!
But how do I print hex dump of it.
I tried:
print "%02x " % ret[i],
print "%02x " % hex(ret[i]),
print format(ret[i],'02x'),
print format(hex(ret[i],'02x'),
print "%02x " % hex(int(ret[i])),
All these things resulted in errors.
A similar question is asked here but those answers didn't help me.
How do I do this similar to c
style printf("%02x ",ret[i]);