I am using the following expression in C code:
sprintf(message, "0x6llX; ", someIntValue);
How do I do the same in python?
I know in C what it means.
- the mandatory % character
- a 0 flag for padding
- the 16 as "minimum field width"
- the ll as "length modifiers"
- the x conversion specifier
What I don't know, is how to do it in python...
CodePudding user response:
The same can be achieved using either of the following:
"0x6X; " % someIntValue # Old style
"{:016X}; ".format( someIntValue ) # New style