As I know there are several elegant ways to print left and right padded lines. like this
str = "left_justified"
str.ljust(20, '0');
or
print "{0:{1}<20}".format(str, "=")
the result will be
left_justified=====
What is the best way to print a mid-justified row with padding
source
to share