File size: 783 Bytes
84bd187 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
import os
def lowercase_everything(root_dir):
for root, dirs, files in os.walk(root_dir, topdown=False):
# Rename files
for name in files:
old_path = os.path.join(root, name)
new_path = os.path.join(root, name.lower())
if old_path != new_path:
os.rename(old_path, new_path)
# Rename directories
for name in dirs:
old_path = os.path.join(root, name)
new_path = os.path.join(root, name.lower())
if old_path != new_path:
os.rename(old_path, new_path)
if __name__ == "__main__":
if os.path.exists("vcsky"):
print("Starting lowercase conversion...")
lowercase_everything("vcsky")
print("Conversion complete.") |