As I can see in your code, you write only differences into the output file. You should try add this line before for statement in compare1() function:
file_out.write(file1.readline())