[Tutor] html and mod_python

Patricia G. patriciap.gu at gmail.com
Thu Mar 23 16:45:02 CET 2006


Hi again!
result[0] is the value i got from the database. I tried the following piece
of code and got :

"TypeError: not enough arguments for format string"


   if result [0] in range(0, 101, 10):
            selected_value = result[0]
        else:
            selected_value = '-'

        tag = """
        <select name='percent'>
        <option selected VALUE=%s>%s</option>
        <option VALUE='-'>-</option>
        <option VALUE='0'>0%</option>
        <option VALUE='10'>10%</option>
        <option VALUE='20'>20%</option>
        <option VALUE='30'>30%</option>
        <option VALUE='40'>40%</option>
        <option VALUE='50'>50%</option>
        <option VALUE='60'>60%</option>
        <option VALUE='70'>70%</option>
        <option VALUE='80'>80%</option>
        <option VALUE='90'>90%</option>
        <option VALUE='100'>100%</option>
        </select>""" % (selected_value,selected_value)

    return tag

What did i do wrong?
Thanks,
Patty
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20060323/d588961e/attachment.htm 


More information about the Tutor mailing list