Skip to content

Instantly share code, notes, and snippets.

@cobanov
Created October 4, 2022 08:50
Show Gist options
  • Save cobanov/d879ffe3981a36079333d6da92c8bec3 to your computer and use it in GitHub Desktop.
Save cobanov/d879ffe3981a36079333d6da92c8bec3 to your computer and use it in GitHub Desktop.
# !/usr/bin/python
import os
import shutil
folder_path = "/Users/cobanov/Downloads/audio_files/"
dst_folder = "destionat_path"
extension = (".mp3", ".mp4") # has to be tuple
for root, dirs, files in os.walk(folder_path, topdown=False):
for name in files:
if name.endswith(extension):
src = os.path.join(root, name)
dst = os.path.join(dst_folder, name)
# print(src)
# shutil.copyfile(src, dst)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment