Python Time conversion h:m:s to seconds
>>> import time, datetime
>>> a = time.strptime("00:11:06", "%H:%M:%S")
>>> datetime.timedelta(hours=a.tm_hour, minutes=a.tm_min, seconds=a.tm_sec).seconds
666
And here's a cheeky one liner if you're really intent on splitting over ":"
>>> s = "00:11:06"
>>> sum(int(i) * 60**index for index, i in enumerate(s.split(":")[::-1]))
666
def hms_to_seconds(t):
h, m, s = [int(i) for i in t.split(':')]
return 3600*h + 60*m + s