Message 218782 - Python tracker (original) (raw)

I don't understand why it works with "<", "=" or ">":

"{0:\x00<6d}".format(123) '123\x00\x00\x00'

But not without:

"{0:\x006d}".format(123) Traceback (most recent call last): File "", line 1, in ValueError: Invalid format specifier

Compare it to:

"{0:6d}".format(123) ' 123' "{0:06d}".format(123) '000123'