<filename>examples/tqt/shiftadder/utils.py<gh_stars>1-10
import os, shutil


def create_exp_dir(path, scripts_to_save=None):
    if not os.path.exists(path):
        os.mkdir(path)
    print('Experiment dir : {}'.format(path))

    if scripts_to_save is not None:
        os.mkdir(os.path.join(path, 'scripts'))
        for script in scripts_to_save:
            dst_file = os.path.join(path, 'scripts', os.path.basename(script))
            shutil.copyfile(script, dst_file)


def exp_record(note, args_to_save, save_path):
    f = open(note, 'a')
    f.write('%s\t%s\n' % (save_path, args_to_save))
    f.close()
