tds = ['<tr><td>%s</td><td>%s</td></tr>' % (name, score) for name, score in d.iteritems()] print '<table>' print '<tr><th>Name</th><th>Score</th><tr>' print '\n'.join(tds) print '</table>'
相关分类