Couldn't you just use a loop?
print "<select>"
for hour in range(0, 24):
for minute in range(0, 60, 10):
time = "%2d:%.2d" % (hour, minute)
if time == saved_value:
print """<option selected="selected">"""
else:
print """<option>"""
print time
print """</option>"""
print """</select>""" And out of interest, what system are you using? Straight CGI? mod_python? CherryPy?