Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import time
- from time import gmtime, strftime
- #the counter in my case is 20 minutes.
- #i want a script to run in 20 minutes
- counter = 1200
- while counter != 0:
- #this is your local notebook time, as it changes in seconds
- #i.e. for example 23:34:35
- date = strftime("%H:%M:%S")
- print(date, 'The next script is going to be run in %d seconds' % counter, end='\r')
- #this sleep is 1 second, for ex. 23:33:32, 23:33:31, so on
- time.sleep(1)
- counter -= 1
- #initial = time.time()
- #while True:
- #print(time.time() - initial, end='\r')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement