I have simply opened file in append mode in linux. script 1 : file = open("output.log", "a") file.write() file.flush() script 2: file = open("output.log", "a") file.write() file.flush() It writes properly to the file.