import os import shutil from tqdm import tqdm gb_games = [] gbc_games = [] folder_path = "/Users/wotori/Documents/ROMS/GB/" for file_name in os.listdir(folder_path): if ( file_name.endswith(".gb") and ("(U)" in file_name or "(UE)" in file_name) and "[!]" in file_name ): gb_games.append(file_name) elif ( file_name.endswith(".gbc") and ("(U)" in file_name or "(UE)" in file_name) and "[!]" in file_name ): gbc_games.append(file_name) gb_folder = "/Volumes/NO NAME/ALL_GB/" gbc_folder = "/Volumes/NO NAME/ALL_GBC/" for game in tqdm(gb_games, desc='Copying GB games'): game_path = os.path.join(folder_path, game) shutil.copy(game_path, gb_folder) for game in tqdm(gbc_games, desc='Copying GBC games'): game_path = os.path.join(folder_path, game) shutil.copy(game_path, gbc_folder)