What is a Pythonic way to pad a numeric string with zeroes to the left, i.e. so the numeric string has a specific length?
Just use the rjust method of the string object.
This example will make a string of 10 characters long, padding as necessary.
>>> t = 'test' >>> t.rjust(10, '0') >>> '000000test'