Advertisement
Oleg_Kornilov

a counter connected with your local PC time in real time

Nov 20th, 2016
339
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.56 KB | None | 0 0
  1. import time
  2. from time import gmtime, strftime
  3.  
  4. #the counter in my case is 20 minutes.
  5. #i want a script to run in 20 minutes
  6. counter = 1200
  7.  
  8. while counter != 0:
  9.     #this is your local notebook time, as it changes in seconds
  10.     #i.e. for example 23:34:35
  11.     date = strftime("%H:%M:%S")
  12.     print(date, 'The next script is going to be run in %d seconds' % counter, end='\r')
  13.     #this sleep is 1 second, for ex. 23:33:32, 23:33:31, so on
  14.     time.sleep(1)
  15.     counter -= 1
  16.  
  17. #initial = time.time()
  18. #while True:
  19.     #print(time.time() - initial, end='\r')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement