print ["Sorry, i need piece of covert art labeled: ", picpath] p_data = open(picpath).read() # pic = Picture( # encoding=3, # 3 is for utf-8 # mime='image/jpeg', # image/jpeg or image/png # type=3, # 3 is for the cover image # desc=u'Cover', # data=p_data # ) # apic = APIC( # encoding=3, # 3 is for utf-8 # mime='image/jpeg', # image/jpeg or image/png # type=3, # 3 is for the cover image # desc=u'Cover', # data=p_data # ) pic = Picture() pic.load(open(picpath)) flaccount = 0 flext = re.compile(".*\.flac") for f in files: if re.search(flext, f) != None: flaccount = flaccount + 1 ftag = FLAC(f) ftag.clear_pictures() ftag.add_picture(pic) ftag.save exit(0)