Currently have code that looks something like;
print \'{: <5}\'.format(\'test\')
This will pad my string with \' \' if it i
\' \'
You could use str.ljust and slice the string:
str.ljust
>>> 'testsdf'.ljust(5)[:5] 'tests' >>> 'test'.ljust(5)[:5] 'test '