Skip to content

Instantly share code, notes, and snippets.

@swharden
Created July 3, 2023 01:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save swharden/de8320a54983f84fb1ce16d873562773 to your computer and use it in GitHub Desktop.
Save swharden/de8320a54983f84fb1ce16d873562773 to your computer and use it in GitHub Desktop.
Python script to rename all files in a folder to lowercase
"""
This script renames all files in a folder to lowercase
"""
import pathlib
import shutil
folder = "./full/"
for path in pathlib.Path(folder).glob("*.*"):
path2 = path.parent.joinpath(str(path.name).lower())
shutil.move(path, path2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment