On 09/10/2007, Dick Moores <[EMAIL PROTECTED]> wrote:
> What's the best way to get hours in 2 or more digits, and minutes in
> 2 digits, so that the above would be 05:07:36.88? (I'm writing a stopwatch.)

String formatting!

>>> template = '%02d:%02d:%02d.%02d'
>>> template % (1, 22, 3, 44)
'01:22:03.44'

-- 
John.
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to