def recursive_copy(source, dest):
 for (root, _, files) in os.walk(source):
  path_from_source = root.replace(source, '').lstrip('/')
  target_directory = os.path.join(dest, path_from_source)
  if (not os.path.exists(target_directory)):
   os.makedirs(target_directory)
  for name in files:
   file_path_from_source = os.path.join(source, path_from_source, name)
   target_path = os.path.join(target_directory, name)
   shutil.copyfile(file_path_from_source, target_path)

def recursive_copy ( source , dest ) : for ( root , _ , files ) in os . walk ( source ) : path_from_source = root . replace ( source , '' ) . lstrip ( '/' ) target_directory = os . path . join ( dest , path_from_source ) if ( not os . path . exists ( target_directory ) ) : os . makedirs ( target_directory ) for name in files : file_path_from_source = os . path . join ( source , path_from_source , name ) target_path = os . path . join ( target_directory , name ) shutil . copyfile ( file_path_from_source , target_path )
recursively copy the source directory to the destination .