# -*- coding: utf-8 -*-
import os
from openpyxl import Workbook
wb = Workbook()
ws = wb.active
ws.title = "音乐列表"
ws.append(["歌名","路径"])
def file_name(file_dir):
for root, dirs, files in os.walk(file_dir):
for file in files:
item = []
item.append(file)
item.append(os.path.join(root, file))
ws.append(item)
file_name("./")
wb.save("保存.xlsx")