I realized that when I write into a file using python it wait until the end of my Python file to execute it:
outputFile = open("./outputFile.txt","a")
print "Now you have 10sec to see that outputFile.txt is still the same as before"
print "Now if you look at outputFile.txt you will see 'First' and 'Second'"
You can use
flush() or you can set the file object to be unbuffered.
Details on using that parameter for
So you would change your open call to -
outputFile = open("./outputFile.txt", "a", 0)