DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world
Join Text Files In Python
// join contents of text files in current directory
import os
filenames = os.listdir('.')
content = ''
for f in filenames:
content = content + '\n' + open(f).read()
open('joined_file.txt','wb').write(content)





