welcome everybody 🙂🖐
Today I will share with you how to call function every 5 seconds using python and schedule
step 1
install schedule from here : pip install schedule
step 2
import schedule
def task():
print('this is task ;)')
schedule.every(5).seconds.do(task)
while True:
schedule.run_pending()
you can pass arguments to task function
import schedule
def task(name):
print(f'this is {name} task ;)')
schedule.every(5).seconds.do(task, name = 'create app')
while True:
schedule.run_pending()
Now we're done 🤗
Don't forget to like and follow 🙂