from subprocess import call import os # these files will not be converted/normailzed ingnore_files = [ '101 awful cruella sucks - No more annoying Cruella' ] directory = os.getcwd() for root,d_names,f_names in os.walk(directory): for f in f_names: filename = os.path.join(root, f) if filename.endswith(".mp3"): print(filename) if any(ignore_file in filename for ignore_file in ingnore_files): print("skipped due to match in ignore_files list") print("returned {}".format(call(["mp3DirectCut", filename, "/normalize", "/overwrite"])))