I'm using python formating to print some left aligned columns.
This nicely left alignes a
, b
and c
:
out_string = '{:30} {:20} {:10}'.format(a, b, c)
Then I tried using constants, but failed with ValueError: Invalid format specifier
:
ALIGNa = 30
ALIGNb = 20
ALIGNc = 10
out_string = '{:ALIGNa} {:ALIGNb} {:ALIGNc}'.format(a, b, c)
Why does it fail?