How do I copy a folder and its contents (files/subdirectories) in Python with platform independent implementation
问题 I need a function in python that lets me specify the source and destination paths for a folder and copies the source folder recursively into the destination folder. The implementation I am looking for needs to be platform independent 回答1: You could use shutil.copytree: shutil.copytree(src, dst, symlinks=False, ignore=None, copy_function=copy2, ignore_dangling_symlinks=False) Recursively copy an entire directory tree rooted at src, returning the destination directory. The destination directory