Skip to content

Instantly share code, notes, and snippets.

@Sanokei
Created August 8, 2021 06:32
Show Gist options
  • Save Sanokei/4abdd00640c3303b0a79cd79dd61c540 to your computer and use it in GitHub Desktop.
Save Sanokei/4abdd00640c3303b0a79cd79dd61c540 to your computer and use it in GitHub Desktop.
adding zeros to my png files names when i convert them from videos so that it works with DAIN
import os
path = os.getcwd() + '\\images\\'
for filename in os.listdir(path):
missingNumber = 8 - len(filename)
os.rename(path + filename,path + ("0"*missingNumber) + filename)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment