I am trying to make my python code autoupdate. The problem is that the code pulls up four html files, so four new tabs in the browser, every time it runs.
I tried auto-updating using an answer from a similar question: What is the best way to repeatedly execute a function every x seconds in Python?
import time
starttime = time.time()
while True:
# My code here
output_file("first.html", title="First HTML Page")
# More code
output_file("second.html", title="Second HTML Page")
# Even more code
time.sleep(60.0 - ((time.time() - starttime) % 60.0))
The problem with this method is that every minute it pulls up four more tabs-- meaning after four minutes I already have 16 tabs!
Anyone know how to autoupdate using the same tabs? I'd even take deleting the original tabs and replacing them, even though I imagine that's less elegant.
EDIT: I am running Windows, currently using IE, but I am also open to moving to Firefox or Chrome.