Skip to content

Instantly share code, notes, and snippets.

@databyjp
Created February 22, 2022 08:50
Show Gist options
  • Save databyjp/568cfbbffa0ced38686f5c69c629f510 to your computer and use it in GitHub Desktop.
Save databyjp/568cfbbffa0ced38686f5c69c629f510 to your computer and use it in GitHub Desktop.
Had to rename a bunch of files
import os
srcdir = "dl_data/box_scores/json"
files = [f for f in os.listdir(srcdir) if f.endswith('.json') and not f.startswith('00')]
for f in files:
os.rename(os.path.join(srcdir, f), os.path.join(srcdir, '00' + f))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment