본문 바로가기

Python

Copy files in a directory to another directory

반응형
from shutil import copy

# base-network dir
base_net_dir = '/home/dooseop/PycharmProjects/Proj075/TORCS_trained_net/ID0_epoch_5_steer'

# create destination folder
net_dir = os.path.join(learning_params['net_dir'], run_id)
if not tf.gfile.Exists(net_dir):
tf.gfile.MakeDirs(net_dir)


if (isLane):
source = os.listdir(base_net_dir)
for files in source:
copy(os.path.join(base_net_dir, files), net_dir)


'Python' 카테고리의 다른 글

How to fit a curve using scipy.optimize.curve  (0) 2018.10.29
Histogram function  (0) 2017.12.08
Get file list in a directory  (0) 2017.11.30
Perspective transform  (0) 2017.11.21
how to plot a histogram : matplotlib  (0) 2017.09.26