This commit is contained in:
Aéna Aria 2025-12-07 16:19:58 +01:00
parent 41faa54e45
commit bdeef8224d
5 changed files with 469 additions and 0 deletions

View file

@ -0,0 +1,27 @@
from datetime import datetime
with open(r'AInvestigation/data.txt', 'r') as input:
lines = input.read().split('\n')[:-1]
day = 0
times = []
for line in lines:
if line[0] == "=":
day+=1
times.append({})
continue
date,time,_,_,name,part = line.split()
times[day-1][(name,part[1])] = datetime.strptime(date+" "+time,"%Y-%m-%d %H:%M:%S")
for num,day in enumerate(times):
best = [datetime.strptime("23:59:59","%H:%M:%S")-datetime.strptime("00:00:01","%H:%M:%S"),""]
for name,part in day.keys():
if part == '2':
diff = [day[name,'2'] - day[name,'1'],name]
best = min(best,diff, key=lambda x:x[0])
print("Best difference of day "+str(num+1)+": "+str(best[0])+" (by "+best[1]+")")
# print(times)