How do I get an integer to fill 0\'s to a fixed width in python 3.2 using the format attribute? Example:
a = 1 print(\'{0:3}\'.format(a))
gives
Prefix the width with a 0:
0
>>> '{0:03}'.format(1) '001'
Also, you don't need the place-marker in recent versions of Python (not sure which, but at least 2.7 and 3.1):
>>> '{:03}'.format(1) '001'