Best way to schedule tasks in Python

Asep Saputra
Code Storm
Published in
3 min readApr 14, 2022

--

In this post, I want to share ideas on how to create a task scheduler in Python.

task scheduler in Python

First, let’s start with the problem. Why is scheduling needed? Maybe you guys have a different answer to that answer, and so do I.

The first time I used a task schedule was when I fetched real-time (daily) data for analysis and prediction.

The routine is,

  • I withdraw stock data every 5 pm (Jakarta, Indonesia) because the stock market closes at 15:00 and 5 pm is the time when I come home from work.
  • The data that has been successfully withdrawn is not reanalyzed because there is already a separate function to analyze and predict the existing data.

At first, I did it manually, but because I found it quite a waste of time I finally thought of doing it on a scheduled basis with the help of Python.

From my incident above, it can be concluded that the decision to use the schedule is very necessary for work that is carried out repeatedly from time to time and has a pattern.

OK, let’s start with how to create a task scheduler in python!

  • Please install the schedule library, free to use anything…

--

--