Created
December 4, 2021 11:33
-
-
Save alaztetik/121e1679e5ec6e4b41a3178c4951473d to your computer and use it in GitHub Desktop.
Creates folders with fixed prefix and incremental numbers at the end
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 | |
def create_folders(num, prefix=''): | |
"""Creates specified numbers of folders with a prefix in front of each""" | |
for num in range(1, num+1): | |
if not os.path.exists(f"{prefix}{str(num)}"): | |
os.makedirs(f"{prefix}{str(num)}") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment