-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.py
More file actions
49 lines (28 loc) · 945 Bytes
/
run.py
File metadata and controls
49 lines (28 loc) · 945 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import os, time
from types import ModuleType
import importlib
if __name__ == "__main__":
day:str = str(input("Enter Day:\n >"))
if (len(day) == 0 or not day.isnumeric()):
print("Day not acceptable format")
exit()
if not (0<int(day)<=12):
print("Day not in acceptable range")
exit()
if (len(day) == 1):
day = "0" + day
dayImport:ModuleType = importlib.import_module(f"2025.{day}")
part1 = getattr(dayImport,"part1")
part2 = getattr(dayImport,"part2")
print("Part 1 answer: ",end="")
startTime = time.time()
p1 = part1()
part1Time = time.time() - startTime
print(p1)
print("Part 1 answer: ",end="")
startTime = time.time()
p2 = part2()
part2Time = time.time()-startTime
print(p2)
print("\nPart 1 time:",str(round(1000*(part1Time),4)) + "ms")
print("Part 2 time:",str(round(1000*(part2Time),4)) + "ms")