|
import os |
|
from typing import List |
|
|
|
|
|
def init_info_csv(data_info_path: str, header: List[str]): |
|
with open(data_info_path, "r") as fp: |
|
if not fp.read().strip(): |
|
add_to_info_csv(data_info_path, header) |
|
|
|
|
|
def add_to_info_csv(data_info_path: str, info: List[str]): |
|
with open(data_info_path, "a") as fp: |
|
fp.write(",".join(list(map(str, info))) + "\n") |
|
|
|
|
|
def create_file_structure(dirs: List[str], files: List[str]): |
|
for dir_path in dirs: |
|
os.makedirs(dir_path, exist_ok=True) |
|
|
|
for file_path in files: |
|
with open(file_path, "a"): |
|
pass |
|
|