File size: 318 Bytes
55d9e05
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
import os

def rename_folders(path):
    i = 1
    for folder_name in os.listdir(path):
        if os.path.isdir(os.path.join(path, folder_name)):
            os.rename(os.path.join(path, folder_name), os.path.join(path, str(i)))
            i += 1


if __name__ == "__main__":
    rename_folders("./path")