Python spacing and aligning strings

You should be able to use the format method:

"Location: {0:20} Revision {1}".format(Location, Revision)

You will have to figure out the format length for each line depending on the length of the label. The User line will need a wider format width than the Location or District lines.

Leave a Comment