python program to open all files in a directory and concatenate their contents into a single output file