Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

0x%016llX from C to python?

I am using the following expression in C code:

sprintf(message, "0x%016llX; ", someIntValue);

How do I do the same in python?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

I know in C what it means.

  1. the mandatory % character
  2. a 0 flag for padding
  3. the 16 as "minimum field width"
  4. the ll as "length modifiers"
  5. the x conversion specifier

What I don’t know, is how to do it in python…

>Solution :

The same can be achieved using

"0x%016X; " % someIntValue

or

"{:016X}; ".format( someIntValue )
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading