File size: 598 Bytes
e87025c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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