Python 2.6 defines str.format(β¦) , which from Python 3.0 is preferable to the old style % format string. Looking at mini-language ", it seems that the character } cannot be used as a pad character.
This seems like a strange omission to me. Is it possible to somehow escape this character and use it as a fill character?
I know that I can fill in some unique character and then use str.replace or any number of other similar tricks to achieve the same result, but this seems like a hack for me ...
Edit: for me something like
>>> "The word is {0:}<10}".format("spam") 'The word is spam}}}}}}'
source share