Search This Blog

Showing posts with label time. Show all posts
Showing posts with label time. Show all posts

Friday, August 30, 2019

Python Schedule at every specific Time Interval

1. Install schedule plugin
2. use the below sample

schedulers.py

# Schedule Library imported
import schedule
import time
import datetime

def doScheduler ():
    print ( "Schedule starts @ ", datetime.datetime.now() );

# Task scheduling
# After every 10mins doScheduler () is called. 
schedule.every(10).minutes.do(doScheduler )
  
# After every hour doScheduler () is called.
schedule.every().hour.do(doScheduler )
  
# Every day at 12am or 00:00 time doScheduler () is called.
schedule.every().day.at("00:00").do(doScheduler )
  
# After every 5 to 10mins in between run doScheduler ()
schedule.every(5).to(10).minutes.do(doScheduler )
  
# Every monday doScheduler () is called
schedule.every().monday.do(doScheduler )
  
# Every tuesday at 18:00 doScheduler () is called
schedule.every().tuesday.at("18:00").do(doScheduler )

if __name__ == "__main__": schedule.every( 3 ).minutes.do( doScheduler )   
# Loop so that the scheduling task
# keeps on running all time.
while True:
  
     # Checks whether a scheduled task 
     # is pending to run or not
     schedule.run_pending()
     time.sleep(1)



#Enjoy !

Tuesday, September 15, 2009

time management 'rocks in bucket' story

time management 'rocks in bucket' story

Use this time management story to show how planning is the key to time management.

Start with a bucket, some big rocks enough to fill it, some small stones, some sand and water.

Put the big rocks in the bucket - is it full?

Put the small stones in around the big rocks - is it full?

Put the sand in and give it a shake - is it full?

Put the water in. Now it's full.

The point is: unless you put the big rocks in first, you won't get them in at all.

In other words: Plan time-slots for your big issues before anything else, or the inevitable sand and water issues will fill up your days and you won't fit the big issues in (a big issue doesn't necessarily have to be a work task - it could be your child's sports-day, or a holiday).

Hit Counter


View My Stats