So I am writing a program which writes data into an opened excel file. 
The issue is that I need to run an infinite loop and the program is closed when it is killed. 
The file isn't even created when I do this. workbook.close() is outside the infinite while loop. 
Is there a flush method within xlsxwriter so that I can save the data?
I was able to get around the problem by invoking the workbook.save() inside the loop. I have this long running program that keeps appending lines to the excel file and once the save method is invoked inside the loop, I can see new lines getting added as the program progresses.
Is there a flush method in the xlsxwriter module? [Python 2.7]