BoomShakalaka
BoomShakalaka

Reputation: 21

Is there a flush method in the xlsxwriter module? [Python 2.7]

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?

Upvotes: 2

Views: 1577

Answers (2)

jmcnamara
jmcnamara

Reputation: 41644

Is there a flush method in the xlsxwriter module

No. You can only close()/save a file once with XlsxWriter.

Upvotes: 0

user14565550
user14565550

Reputation: 21

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.

Upvotes: 2

Related Questions