本文整理汇总了Python中mutagen.flac.Picture.load方法的典型用法代码示例。如果您正苦于以下问题:Python Picture.load方法的具体用法?Python Picture.load怎么用?Python Picture.load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mutagen.flac.Picture
的用法示例。
在下文中一共展示了Picture.load方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: open
# 需要导入模块: from mutagen.flac import Picture [as 别名]
# 或者: from mutagen.flac.Picture import load [as 别名]
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)