created the base concept of the script
This commit is contained in:
19
tempbox/tempbox.py
Normal file
19
tempbox/tempbox.py
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
import tempfile
|
||||||
|
import os
|
||||||
|
|
||||||
|
|
||||||
|
def create_folders(number_folders, base_path):
|
||||||
|
"""creates an amount of folders and returning its path"""
|
||||||
|
while number_folders > 0:
|
||||||
|
number_folders = number_folders - 1
|
||||||
|
|
||||||
|
folder_name = f"folder_{number_folders}"
|
||||||
|
full_path = os.path.join(base_path, folder_name)
|
||||||
|
|
||||||
|
os.mkdir(full_path)
|
||||||
|
print(f"'{full_path}' was created")
|
||||||
|
|
||||||
|
|
||||||
|
# Creates a temporary directory.
|
||||||
|
with tempfile.TemporaryDirectory() as temp_dir:
|
||||||
|
print(f"Folderpath: {temp_dir}")
|
||||||
Reference in New Issue
Block a user