Skip to content

Instantly share code, notes, and snippets.

@Santara
Created May 30, 2019 07:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Santara/317d51576799740954e3e85d65f1eede to your computer and use it in GitHub Desktop.
Save Santara/317d51576799740954e3e85d65f1eede to your computer and use it in GitHub Desktop.
Gathering logs from separate experiments into one directory with proper naming of the logs
import os
from glob import glob
import shutil
root_dir = '.'
for dir in glob(root_dir+'/*'):
dir_name = dir.split('/')[-1]
if os.path.exists(os.path.join(dir, 'log1.csv')):
shutil.copy2(os.path.join(dir, 'log1.csv'), os.path.join(root_dir, 'logdump', dir_name+'.csv'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment