As we know we are going to use "Unix" cat command (unless you are looking for a pythonic way or being performance concious)
You can use
import os
os.system("cd mydir;cat * > merged.txt")
or
as pointed by 1_CR (Thanks) and explained here
Python: How to Redirect Output with Subprocess?