1. Problem
When dealing with dataset, data is often named in a “equal-length” way, like below:
000000.jpg 000001.jpg ... 199999.jpg 200000.jpg
How to format such string in python? Here we go.
2. Solution
filename = ['{:0>6}.jpg'.format(i) for i in range(20000)]
Done.