I have up to 8 seperate Python processes creating temp files in a shared folder. Then I\'d like the controlling process to append all the temp files in a certain order into
Use fileinput:
with open("bigfile.txt", "w") as big_file: with fileinput.input(files=tempfiles) as inputs: for line in inputs: big_file.write(line)
This is more memory efficient than @RafeKettler's answer as it doesn't need to read the whole file into memory before writing to big_file.
big_file