我想從文件中取出行並將它們放入將顯示在Web上的表中。我需要能夠單獨引用這些行來使用if ... else語句更改表信息。Python:在表中引用行
任何人都可以幫助我找到一種方法來引用這些行時,他們被拉 - 這是我的代碼到目前爲止。
#for each line in emaildomains - print out on page to view
print '<form method=\'post\' name="updateUsers">'
print '<table border="1">'
print '<tr>'
print '<th>Email Address</th>'
print '<th>Delete Email</th>'
print '<th>Make Changes?</th>'
print '</tr>'
n=1
for line in emaildomains:
print '<tr>'
print '<td><input type="text" name=\"useraddress\", n, value ="%s">' %line
print '<input type="hidden" name=useraddress_org value ="%s"></td>' %line
print '<td><input type=\"radio\" name=\"deleteRadio\", n, style=margin-left:50px></td>'
print '<td><input type="submit" value="Edit Users" /></td>'
print '</tr>'
n+=1
print '</table>'
print '</form>'