(glob, dst_dir, src_dir=Path('.'))
| 1 | def copy_file(glob, dst_dir, src_dir=Path('.')) : |
| 2 | for src_pth in src_dir.glob(glob) : |
| 3 | dst_pth = dst_dir / src_pth.relative_to(src_dir) |
| 4 | if src_pth.is_file() and not dst_pth.parent.exists() : |
| 5 | dst_pth.parent.mkdir(parents=True) |
| 6 | shutil.copy(str(src_pth), str(dst_pth)) |