def sec_to_hms(sec):
 if (sec <= (-1)):
  return '[endless]'
 h = (sec / 3600)
 sec %= 3600
 m = (sec / 60)
 sec %= 60
 return ('[%d:%02d:%02d]' % (h, m, sec))

def sec_to_hms ( sec ) : if ( sec <= ( - 1 ) ) : return '[endless]' h = ( sec / 3600 ) sec %= 3600 m = ( sec / 60 ) sec %= 60 return ( '[%d:%02d:%02d]' % ( h , m , sec ) )
converts integer sec to h:mm:ss format .