I'm trying to use this on my program to get an mp3 file regardless of case, and I've this code:
import glob
import fnmatch, redef custom_song(name):for song in re.compile(fnmatch.translate(glob.glob("../music/*"+name+"*.mp3")), re.IGNORECASE):print (song)
custom_song("hello")
But when I execute the script i get the following error:
File "music.py", line 4, in custom_songfor song in re.compile(fnmatch.translate(glob.glob("../music/*"+name+"*.mp3")), re.IGNORECASE):
TypeError: '_sre.SRE_Pattern' object is not iterable
How can I fix it?