I am trying to put together some simple code to refresh a speedtest website every 15 minutes and save the results.
I am trying to add in a simple variable output to keep track of the number of entries, but it keeps throwing up an error.
import sched, time, webbrowser
global n
n = 0
s = sched.scheduler(time.time, time.sleep)
def timesup(sc):
n = n + 1
print "This is run number ", n
handle = webbrowser.get()
handle.open('http://www.speedtest.com', new=0)
sc.enter(10, 1, timesup, (sc,))
s.enter(10, 1, timesup, (s,))
s.run()
Any comments/suggestions would be appreciated.