[Solved] Python/Calc: Viewing intermediate results
Posted: Thu Jul 25, 2013 10:41 am
I'm developing a Python macro embedded in a Calc document to scrape data from various web pages and paste some results in cells in the spreadsheet.
It works, but when I start the macro, I have to wait until the macro has finished before I can see the results. Here's a very simple script to demonstrate the problem:
I would like to see the updated cells as they are updated, rather than wait until the end of the script. A similar Excel VBA macro allows me to see the cells as they update, as does an OpenOffice Basic macro
Any ideas?
It works, but when I start the macro, I have to wait until the macro has finished before I can see the results. Here's a very simple script to demonstrate the problem:
Code: Select all
import time
def myTest3():
oDoc = XSCRIPTCONTEXT.getDocument()
oSheets = oDoc.getSheets()
mySheet = oSheets.getByName("Sheet1")
mySheet.getColumns().removeByIndex(0, 1)
for i in range(0,5):
mySheet.getCellByPosition(0,i).Value = i
time.sleep(1)
Any ideas?