$ python weekday2.py
***** preprocessed *****
_buf.extend(('''<select name="weekday">\n''', ));
selected = { str(params.get('weekday')): ' selected="selected"' }
_buf.extend(('''  <option>-</option>
  <option value="1"''', to_str(selected.get('1')), '''>Sun</option>
  <option value="2"''', to_str(selected.get('2')), '''>Mon</option>
  <option value="3"''', to_str(selected.get('3')), '''>Tue</option>
  <option value="4"''', to_str(selected.get('4')), '''>Wed</option>
  <option value="5"''', to_str(selected.get('5')), '''>Thu</option>
  <option value="6"''', to_str(selected.get('6')), '''>Fri</option>
  <option value="7"''', to_str(selected.get('7')), '''>Sat</option>
</select>\n''', ));

***** output *****
<select name="weekday">
  <option>-</option>
  <option value="1">Sun</option>
  <option value="2">Mon</option>
  <option value="3" selected="selected">Tue</option>
  <option value="4">Wed</option>
  <option value="5">Thu</option>
  <option value="6">Fri</option>
  <option value="7">Sat</option>
</select>

