Skip to content

Instantly share code, notes, and snippets.

@MAGANER
Created July 9, 2021 11:24
Show Gist options
  • Save MAGANER/dcd6d5509b4c75d134593b03de5977af to your computer and use it in GitHub Desktop.
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.
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