import csv
def toSeconds(t):
return int(t.split(":")[0]) * 60 + int(t.split(":")[1])
def toTime(seconds):
minutes = seconds // 60
seconds = seconds % 60
return str(minutes) + ":" + str(seconds)
with open("time.csv") as timedata:
total = 0
for row in csv.reader(timedata):
for col in row:
total += toSeconds(col)
total = toTime(total)
1条答案
按热度按时间798qvoo81#
我想这应该能解决你的问题。