Let’s work with files and directories. Copying specific files between directories is a few lines of Python code job.
Write a code to copy only .txt files between directories on your disc.
Pathlib copy file
import shutil from pathlib import Path source_path = Path("c:/foobar/") text_files = source_path.glob("*.txt") destination = Path("c:/MyProject/MyFiles/MyDirectory2020/") for file in text_files: shutil.copy(str(file), str(destination))