Python Forum
Creating multiple text fies from new url retrieve results
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Creating multiple text fies from new url retrieve results
#2
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:
pip install APScheduler
code:
"""
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
Reply


Messages In This Thread
RE: Creating multiple text fies from new url retrieve results - by Larz60+ - Jul-13-2017, 10:57 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Photo put a green boarder and text around multiple pictures jackosullivan 5 1,550 Jul-05-2022, 10:39 AM
Last Post: snippsat
Question Pandas : How to create an algorithm that helps me improve results and creating new co Smordy 8 2,338 Apr-10-2022, 10:28 PM
Last Post: Larz60+
  [Answered] Retrieve a set of rows from text file knob 4 1,839 Dec-22-2021, 07:45 PM
Last Post: knob
  Replace String in multiple text-files [SOLVED] AlphaInc 5 8,251 Aug-08-2021, 04:59 PM
Last Post: Axel_Erfurt
  Open and read multiple text files and match words kozaizsvemira 3 6,806 Jul-07-2021, 11:27 AM
Last Post: Larz60+
  Reading Multiple text Files in pyhton Fatim 1 1,969 Jun-25-2021, 01:37 PM
Last Post: deanhystad
Question How to extract multiple text from a string? chatguy 2 2,428 Feb-28-2021, 07:39 AM
Last Post: bowlofred
  Writing unit test results into a text file ateestructural 3 4,821 Nov-15-2020, 05:41 PM
Last Post: ateestructural
  cx_Oracle.DatabaseError: Error while trying to retrieve text from error ORA-01804 rajeshparadker 0 8,671 Nov-12-2020, 07:34 PM
Last Post: rajeshparadker
  Search Results Web results Printing the number of days in a given month and year afefDXCTN 1 2,272 Aug-21-2020, 12:20 PM
Last Post: DeaD_EyE

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020