Copying the ".txt" file from one folder to another is very simple and the question contains logic. Only the missing part replaces the correct information, as shown below:
import os, shutil, glob src_fldr = r"Source Folder/Directory path";
below the line of code will copy the file with * .txt extension files from src_fldr to dst_fldr
for txt_file in glob.glob(src_fldr+"\\*.txt"): shutil.copy2(txt_file, dst_fldr);
source share