I’d like to copy the files that have a specific file extension to a new folder. I have an idea how to use os.walk but specifically how would I go about using that? I’m searching for the files with a specific file extension in only one folder (this folder has 2 subdirectories but the files I’m looking for will never be found in these 2 subdirectories so I don’t need to search in these subdirectories). Thanks in advance.
I’d like to copy the files that have a specific file extension to a
Share
Read the documentation of the shutil module to choose the function that fits your needs (shutil.copy(), shutil.copy2() or shutil.copyfile()).