Python strings have a method called zfill that allows to pad a numeric string with zeros to the left.
zfill
In : str(190).zfill(8) Out: \'00000190\' <
See Format Specification Mini-Language:
In [1]: '{:<08d}'.format(190) Out[1]: '19000000' In [2]: '{:>08d}'.format(190) Out[2]: '00000190'