import errno
import os
from datetime import datetime

def filecreation(list, filename):
    mydir = os.path.join(os.getcwd(), datetime.now().strftime(
        '%Y-%m-%d_%H-%M-%S'))
try:
    os.makedirs(mydir)
except OSError as e:
    if e.errno != errno.EEXIST:
        raise
with open(os.path.join(mydir, filename), 'w') as d:
    d.writelines(list)
Создание папки с отметкой времени