How to Batch Generate Empty Folders in Python


In this example, we will learn how to create multiple empty folders in batch with Python.

Source Code

#! /usr/bin/env python3
# -*- coding: utf-8 -*-

import os,sys
base = 'E:/'
i = 1
for j in range(10):
    file_name = base+str(i)
    os.mkdir(file_name)
    i=i+1 

Output:

Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
Advertisement