"Luis N" <[EMAIL PROTECTED]> wrote > I'd like the below to be a single line if possible.
Beware compression for the sake of it. However we can simplify a bit using divmod() > hours = metrics.totaltime/3600000 > minutes = (metrics.totaltime - 3600000*hours)/60000 > seconds = (metrics.totaltime - 3600000*hours - 60000*minutes)/1000 hours,minutes = divmod(metrics.totaltime/1000, 3600) # get rid of the ms here minutes.seconds = divmod(minutes, 60) > Would it be possible to simplify this with a generator expression > e.g. > > total_time = tuple((...)) Possibly, but the above is simple enough for my tastes! :-) Alan G. _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor