Created
April 30, 2023 19:16
-
-
Save wotori/e74b3481448f895232e327389fa2b374 to your computer and use it in GitHub Desktop.
copy U or UE and [!] gb games
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment