Jul-13-2017, 10:57 PM
The following is a modified example from the APScheduler that should do the trick.
I have not tested it, so you may find a bug or two
the scheduler can be downloaded with:
I have not tested it, so you may find a bug or two
the scheduler can be downloaded with:
pip install APSchedulercode:
""" This code is a modified version of the tornado scheduler from the APScheduler package examples """ import os from tornado.ioloop import IOLoop from apscheduler.schedulers.tornado import TornadoScheduler COUNT = 1 def job(): webbrowser.open('http://127.0.0.1:56781/mavlink/') filename = 'testing{}.txt'.format(COUNT) COUNT += 1 urllib.urlretrieve('http://127.0.0.1:56781/mavlink/', filename) if __name__ == '__main__': scheduler = TornadoScheduler() scheduler.add_job(job, 'interval', seconds=3) scheduler.start() print('Press Ctrl+{0} to exit'.format('Break' if os.name == 'nt' else 'C')) # Execution will block here until Ctrl+C (Ctrl+Break on Windows) is pressed. try: IOLoop.instance().start() except (KeyboardInterrupt, SystemExit): pass