I find using str.format much more elegant:
'{0: <5}'.format('ss')
'ss '
'{0: <5}'.format('sss')
'sss '
'{0: <5}'.format('ssss')
'ssss '
'{0: <5}'.format('sssss')
'sssss'
If you want to align the string to the right use > instead of <:
'{0: >5}'.format('ss')
' ss'