def cvsecs(time):
 if is_string(time):
  if ((',' not in time) and ('.' not in time)):
   time = (time + '.0')
  expr = '(\\d+):(\\d+):(\\d+)[,|.](\\d+)'
  finds = re.findall(expr, time)[0]
  nums = list(map(float, finds))
  return ((((3600 * int(finds[0])) + (60 * int(finds[1]))) + int(finds[2])) + (nums[3] / (10 ** len(finds[3]))))
 elif isinstance(time, tuple):
  if (len(time) == 3):
   (hr, mn, sec) = time
  elif (len(time) == 2):
   (hr, mn, sec) = (0, time[0], time[1])
  return (((3600 * hr) + (60 * mn)) + sec)
 else:
  return time

def cvsecs ( time ) : if is_string ( time ) : if ( ( ',' not in time ) and ( '.' not in time ) ) : time = ( time + '.0' ) expr = '(\\d+):(\\d+):(\\d+)[,|.](\\d+)' finds = re . findall ( expr , time ) [ 0 ] nums = list ( map ( float , finds ) ) return ( ( ( ( 3600 * int ( finds [ 0 ] ) ) + ( 60 * int ( finds [ 1 ] ) ) ) + int ( finds [ 2 ] ) ) + ( nums [ 3 ] / ( 10 ** len ( finds [ 3 ] ) ) ) ) elif isinstance ( time , tuple ) : if ( len ( time ) == 3 ) : ( hr , mn , sec ) = time elif ( len ( time ) == 2 ) : ( hr , mn , sec ) = ( 0 , time [ 0 ] , time [ 1 ] ) return ( ( ( 3600 * hr ) + ( 60 * mn ) ) + sec ) else : return time
will convert any time into seconds .