I want to fill out a string with spaces. I know that the following works for zero\'s:
>>> print \"\'%06d\'\"%4 \'000004\'
But wha
You can do this with str.ljust(width[, fillchar]):
Return the string left justified in a string of length width. Padding is done using the specified fillchar (default is a space). The original string is returned if width is less than len(s).
len(s)
>>> 'hi'.ljust(10) 'hi '