Following this article I have managed to do the following example code:
import subprocess import time from apscheduler.schedulers.background import BackgroundSche