[Python] python获取mp3文件信息 →→→→→进入此内容的聊天室

来自 , 2021-04-05, 写在 Python, 查看 150 次.
URL http://www.code666.cn/view/b937176d
  1. import os, sys
  2. from ID3 import *
  3.  
  4. files = os.listdir(os.getcwd())
  5.  
  6. for f in files:
  7.     x = os.path.splitext(f)
  8.     if x[1] == '.mp3':
  9.         n = x[0].split(' - ')
  10.         author = n[0]
  11.         title = n[1]
  12.         id3info = ID3(f)
  13.         id3info['ARTIST'] = author
  14.         id3info['TITLE'] = title
  15.         print f+' id3 tagged.'
  16. print 'Done!'
  17. #//python/5297

回复 "python获取mp3文件信息"

这儿你可以回复上面这条便签

captcha