Created
July 9, 2021 11:24
-
-
Save MAGANER/dcd6d5509b4c75d134593b03de5977af to your computer and use it in GitHub Desktop.
i wanted to concatenate different number of .mp3 files, so this script provides such ability.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from functools import reduce | |
def read(file): | |
with open(file,"rb") as f: | |
return f.read() | |
all_data = list(map(read,sys.argv[1:])) | |
concated = reduce(lambda a,b:a+b,all_data) | |
concated = concated | |
name = input("enter concated file name:") | |
with open(name,"wb") as f: | |
f.write(concated) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment