Skip to content

Instantly share code, notes, and snippets.

@alik472
Created June 26, 2020 10:28
Show Gist options
  • Save alik472/cdda9c18708c8c616ed82e8d9c5c548e to your computer and use it in GitHub Desktop.
Save alik472/cdda9c18708c8c616ed82e8d9c5c548e to your computer and use it in GitHub Desktop.
Rename all files to uppercase
import os
files = os.listdir('.')
for f in files:
newname = f.upper()
if newname == f:
continue
if newname in files:
print( "error: %s already exists" % newname )
os.rename(f, newname)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment