This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from crontab import CronTab | |
from datetime import datetime | |
cron = CronTab() | |
cmds = { | |
'python ~/code/reminder.py': '0/30 9-18 * * *', | |
'~/code/backup.sh': '0/30 9-18 * * *', | |
} | |
for cmd, cron_str in cmds.items(): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Module containing utility functions to time code snippets. | |
""" | |
import contextlib | |
import time | |
@contextlib.contextmanager | |
def timelogger(msg_prefix:str='Executed in : ', msg_suffix:str='s', logger=print): |
OlderNewer