Format integers by default, and then in a six-character field with left justification and zero padding:
x = 1234 res = 'integers: ...%d...%-6d...%06d' % (x, x, x) print( res )