generated from public/aoc_template
Compare commits
No commits in common. "64234432c31a8db71ed04703cf9e92d10c384161" and "1a3c560969402c55c6e18e43e67a86ab77ab6e6a" have entirely different histories.
64234432c3
...
1a3c560969
14
start_day.py
14
start_day.py
@ -5,14 +5,13 @@ from os.path import exists
|
|||||||
from platform import system
|
from platform import system
|
||||||
from subprocess import call
|
from subprocess import call
|
||||||
from time import sleep
|
from time import sleep
|
||||||
from tools.tools import human_readable_time_from_delta
|
|
||||||
import webbrowser
|
import webbrowser
|
||||||
|
|
||||||
|
|
||||||
YEAR = 2023
|
YEAR = 2023
|
||||||
CHARMS = {
|
CHARMS = {
|
||||||
"Linux": "/usr/local/bin/charm",
|
'Linux': '/usr/local/bin/charm',
|
||||||
"Windows": r"C:\Users\pennywise\AppData\Local\JetBrains\Toolbox\scripts\pycharm.cmd",
|
'Windows': r'C:\Users\pennywise\AppData\Local\JetBrains\Toolbox\scripts\pycharm.cmd'
|
||||||
}
|
}
|
||||||
|
|
||||||
arg_parser = ArgumentParser()
|
arg_parser = ArgumentParser()
|
||||||
@ -38,14 +37,9 @@ if start > now:
|
|||||||
print("Do you really want to wait %d days?" % time_wait.days)
|
print("Do you really want to wait %d days?" % time_wait.days)
|
||||||
exit()
|
exit()
|
||||||
|
|
||||||
while time_wait.seconds > 0:
|
for x in range(time_wait.seconds, -1, -1):
|
||||||
print("Day %d starts in %s.\r" % (DAY, human_readable_time_from_delta(time_wait)))
|
print("Day starts in %02ds.\r" % x)
|
||||||
if time_wait.seconds > 70:
|
|
||||||
wait = min(1, time_wait.seconds // 3600) * 3600 + min(1, time_wait.seconds // 60) * 60
|
|
||||||
sleep(wait)
|
|
||||||
else:
|
|
||||||
sleep(1)
|
sleep(1)
|
||||||
time_wait = start - datetime.now()
|
|
||||||
|
|
||||||
webbrowser.open("https://adventofcode.com/%d/day/%d" % (YEAR, DAY))
|
webbrowser.open("https://adventofcode.com/%d/day/%d" % (YEAR, DAY))
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user