本文实例讲述了python从mp3文件获取id3的方法。分享给大家供大家参考。具体如下:
def getID3(filename):
fp = open(filename, 'r')
fp.seek(-128, 2)
fp.read(3) # TAG iniziale
title = fp.read(30)
artist = fp.read(30)
album = fp.read(30)
anno = fp.read(4)
comment = fp.read(28)
fp.close()
return {'title':title, 'artist':artist, 'album':album, 'anno':anno}
希望本文所述对大家的Python程序设计有所帮助。
python怎么学习?python怎么入门?python在哪学?python怎么学才快?不用担心,这里为大家提供了python速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号