Skip to content

Instantly share code, notes, and snippets.

@joshuacook
Created May 8, 2018 18:27
Show Gist options
  • Save joshuacook/23a5f6d031f2ab3761214deb4c16e501 to your computer and use it in GitHub Desktop.
Save joshuacook/23a5f6d031f2ab3761214deb4c16e501 to your computer and use it in GitHub Desktop.
import os
files = [f.split(' - ') for f in os.listdir('./') if 'ipynb' not in f]
files_up = [[v.zfill(3), n] for v, n in files]
files = [v+" - "+n for v, n in files]
files_up = [v+" - "+n for v, n in files_up]
change = list(zip(files, files_up))
for f in change[1:]:
os.rename(*f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment