这个错误弄了一个下午才搞定!
for row in rows:
print row
'<tr>'
'<td>%s</td>' % row[2]
'<td>%s</td>' % row[1]
'<td>%s</td>' % row[3].replace("/r/n", "<br>")
'</tr>'
改为
for row in rows:
print row
'<tr>'
'<td>%s</td>' % row[2]
'<td>%s</td>' % row[1]
'<td>%s</td>' % htmltext(row[3]).replace("/r/n", "<br>")
'</tr>'
不报错了。
解决的过程,试着打印类型:
context = "I'm a string"
print type(context)
print type(row[3])
结果是:
<class 'quixote.html._py_htmltext.htmltext'>
<type 'str'>
是Quixote的原因?看来PTL还得仔细看看。








改为








不报错了。
解决的过程,试着打印类型:



结果是:
<class 'quixote.html._py_htmltext.htmltext'>
<type 'str'>
是Quixote的原因?看来PTL还得仔细看看。