Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- import sys
- import time
- from datetime import datetime
- from datetime import timedelta
- os.chdir(os.path.dirname(os.path.abspath(__file__))) # Camino a roundabout.mp3
- h, m = 16, 20 # Hora y minuto en formato 24:60
- if len(sys.argv) > 1:
- h, m = int(sys.argv[1]), int(sys.argv[2])
- now = datetime.now()
- target = datetime(now.year, now.month, now.day, h, m, 0)
- target -= timedelta(seconds = 43.8) # Tarda aprox 44 en llegar al drop
- t_step = 0.01
- while (target - now).total_seconds() > t_step:
- now = datetime.now()
- time.sleep(t_step)
- os.system("mpv roundabout.mp3")
- print("To be continued...")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement