divmod函数处理结果,第一个是商,第二个余数1 def humanize_time(secs): 2 """ 4 """ 5 mins, secs = divmod(secs, 60) 6 hours, mins = divmod(mins, 60) 7 return '%02d:%02d:%02f' % (hours, mins, secs)