Skip to content

Instantly share code, notes, and snippets.

@Neko288
Created December 12, 2021 04:01
Show Gist options
  • Save Neko288/af12c80e7051bf01a7a8ee932526ed86 to your computer and use it in GitHub Desktop.
Save Neko288/af12c80e7051bf01a7a8ee932526ed86 to your computer and use it in GitHub Desktop.
フォルダーの中の音楽を全てプレイリストにします。
# coding: UTF-8
import os
playlist_path = 'C:/XXX.m3u'#プレイリストを配置するパス。最後の「/test.m3u」が大事っす。
path = 'D:/XX/XXX'+'/'#プレイリストにしたい音楽があるフォルダーのパス。
def tukuru(songs_path):
with open(playlist_path, 'w',encoding='utf-8') as f:
f.write(songs_path)
songs = os.listdir(path)
songs_path = ''
for song_path in songs:
songs_path += path+song_path+'/n'
tukuru(songs_path)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment