本文實例講述了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程序設計有所幫助。
新聞熱點
疑難解答