I'm new to Python's \x00
string formatting and I was wondering if there is a nice pythonic way of doing something like below? I would like to dynamically insert the \x
formatting into my python strings.
# Is there a way get a similar effect to this?
s = "commandstring \x{}\x{}".format('00', '00')
s = "commandstring \x%s\x%s" % ('00', '00')
Some of my strings will be regular text and numbers, but I also need to insert the Hex values
"\x00"
or do you just want the character with that char code?