把下载的音乐名称和链接转到excel文件

想把下载的音乐名称和链接转到excel文件时上 with open(f'music/{song[1]}.mp3', mode='wb') as f:
f.write(music_data)
print(song[1],'下载成功')
这个一直在报错连下载都没成功with open(file="music/{song[1]}.mp3", mode='a') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'music/{song[1]}.mp3'
试另一个方法 with open(file="C:/Users/dell/Desktop/新建 Microsoft Excel 工作表.xlsx", mode='wb') as f:
f.write(music_data)
print(song[1],'下载成功')
虽然下载成功了但是没弄到文件里文件也打不开了

看起来有些乱。
第一个需求:
改成这样
with open('music/{}.mp3'.format(song[1]), mode='wb') as f:

第二个需求:
要写入 excel 文件, 要用 openpyxl 或者 xlwt 。
不能用open 的方式直接写。

要不你试试 xlsxwriter ?这个库是专门用来写入excel的