# Python Everyday Routine Scheduler

## Introduction

Python built-in event scheduler library sched is a low level library for scheduling events. However, it is not straightforward to use to schedule daily routines.

In this blog post, I would like to discuss about how to use Python sched, time, and datetime for scheduling daily routines.

## Python Everyday Routine Scheduler

### Everyday Routine

Everyday routine is something that the user will always do everyday, including workdays and weekends, at certain fixed time. For example, turning on TV to watch CNN morning news briefing at 8:00 AM and opening browser to check Emails at 10:00 AM are all everyday routines. Manually doing those could be tedious in some scenarios. Therefore, we could employ computer programs to automate the everyday routines.

### Scheduler Python Implementation

In the following implementation, two major scheduler functions, run_every_one_rounded_hour_everyday and run_at_fixed_time_everyday, have been created.

run_every_one_rounded_hour_everyday runs given action every one rounded hour, i.e., 0:00 AM, 1:00 AM, …, 23:00 PM, everyday.

run_at_fixed_time_everyday run given action at specified time everyday. Of course, run_at_fixed_time_everyday can do what run_every_one_rounded_hour_everyday does.

We could see the scheduler program runs as expected.

Lei Mao

03-27-2022

03-27-2022