由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
_Python版 - 如何用 Python 修改 mp3 文件的音乐标题
相关主题
An easter egg in Python :)solve integral eq. embeeded with another integral eq. (转载)
One question about import exe result to python scriptRe: python .pyw问题请教
google app engine 里 加载 numpypython程序运行速度的问题 (转载)
请问如何import一个python文件└ Re: python程序运行速度的问题
ploting 3D surface in python (转载)Is it possible to use c++ objects from python code?
error draw map from shape file Python 3.2 basemap (转载)└ Re: Is it possible to use c++ objects from python code?
damn! just found some more "secrets" INSIDE "this"├ Re: Is it possible to use c++ objects from python code?
Other languages have "variables", Python has "names"└ Re: Re: Is it possible to use c++ objects from python co
相关话题的讨论汇总
话题: mp3话题: fn话题: print话题: metadata话题: python
1 (共1页)
p**z
发帖数: 65
1
eyed3 是一个 Python 库,可以用来处理 mp3 音乐 metadata (比如标题,album,艺
术家名字,等等)。具体信息: http://eyed3.nicfit.net/
一个实用小例子:经常有从 CD 转来的 mp3 音乐文件名已经改成曲目名字了,但是在
iTunes 等音乐管理软件里显示标题仍然是 track1,track2 等。这是因为文件的
metadata 还没有被改变。下面的例子把当前目录里面所有的 mp3 文件的 metadata 音
乐标题 (title) 都改成跟文件名一样(不含 .mp3 后缀)。
from __future__ import print_function
import os
import eyed3
fns = os.listdir(os.getcwdu())
for fn in fns:
if fn.lower().endswith('.mp3'):
aud = eyed3.load(os.path.join(os.getcwdu(), fn))
print(fn)
print('\tCurrent title: ' + aud.tag.title)
aud.tag.title = fn[:-4] # remove the .mp3 extension and set it as new
title
aud.tag.save()
print('\tNew title: ' + aud.tag.title)
1 (共1页)
相关主题
└ Re: Re: Is it possible to use c++ objects from python coploting 3D surface in python (转载)
Question about this python error.error draw map from shape file Python 3.2 basemap (转载)
精华区里新加了很多东西damn! just found some more "secrets" INSIDE "this"
python有好的免费Linux IDE么?Other languages have "variables", Python has "names"
An easter egg in Python :)solve integral eq. embeeded with another integral eq. (转载)
One question about import exe result to python scriptRe: python .pyw问题请教
google app engine 里 加载 numpypython程序运行速度的问题 (转载)
请问如何import一个python文件└ Re: python程序运行速度的问题
相关话题的讨论汇总
话题: mp3话题: fn话题: print话题: metadata话题: python