f = open('bigfile.txt', 'w')
for tempfile in tempfiles:
    while True:
        data = tempfile.read(65536)
if data:
    f.write(data)
else:
    break
Python append multiple files in given order to one big file