Created
June 26, 2020 10:28
-
-
Save alik472/cdda9c18708c8c616ed82e8d9c5c548e to your computer and use it in GitHub Desktop.
Rename all files to uppercase
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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