7 Copies all content from the source directory to the destination directory. 9 if not os.path.exists(dest):
12 for item
in os.listdir(src):
13 src_path = os.path.join(src, item)
14 dest_path = os.path.join(dest, item)
16 if os.path.isdir(src_path):
17 shutil.copytree(src_path, dest_path)
19 shutil.copy2(src_path, dest_path)
22 parser = argparse.ArgumentParser(description=
'Copy contents of a directory to a specified target directory.')
23 parser.add_argument(
'target_directory', type=str, help=
'The target directory where content will be copied.')
25 args = parser.parse_args()
27 current_directory = os.path.dirname(os.path.abspath(__file__))
28 target_directory = args.target_directory
31 print(f
"All content from {current_directory} has been copied to {target_directory}")
33 if __name__ ==
"__main__":
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
def copy_directory_content(src, dest)