本文整理匯總了Python中Playlist.Playlist.get_entries方法的典型用法代碼示例。如果您正苦於以下問題:Python Playlist.get_entries方法的具體用法?Python Playlist.get_entries怎麽用?Python Playlist.get_entries使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Playlist.Playlist
的用法示例。
在下文中一共展示了Playlist.get_entries方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: process
# 需要導入模塊: from Playlist import Playlist [as 別名]
# 或者: from Playlist.Playlist import get_entries [as 別名]
def process(file):
pls_file = file
m3u_file = re.sub(r".pls$", ".m3u", pls_file)
in_playlist = Playlist(pls_file)
pls_entries = in_playlist.get_entries()
output = ["#EXTM3U\n"]
for entry in pls_entries:
output.append("#EXTINF:%s, %s\n%s\n" % (entry[3], entry[2], entry[1]))
print "Converting %s to %s" % (pls_file, m3u_file)
handle = open(m3u_file, "w")
handle.writelines(output)
handle.close