Skip to content

Instantly share code, notes, and snippets.

@zcaceres
Created October 30, 2018 01:19

Revisions

  1. zcaceres created this gist Oct 30, 2018.
    13 changes: 13 additions & 0 deletions folder_lowercase.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    #!/usr/bin/env python3

    from pathlib import Path
    from sys import argv

    # Downcases a the names of all directories inside the current directory.

    path = Path('.')
    dirs = [file for file in path.iterdir() if file.is_dir()]
    for (x, dir) in enumerate(dirs):
    print('Changing', dir)
    dir.rename(dir.name.lower())
    print('Done')