If you don't want to specify the widths at the same time, you can prepare a format string ahead of time, like you were doing - but with another substitution. We use %%
to escape actual % signs in a string. We want to end up with %20s
in our format string when the width is 20, so we use %%%ds
and supply the width variable to substitute in there. The first two % signs become a literal %, and then %d is substituted with the variable.
Thus:
format_template = '%%%ds : %%%ds'
# later:
width = 20
formatter = format_template % (width, width)
# even later:
print formatter % ('Python', 'Very Good')