我刚开始在python中使用peewee。但是,因为我正在使用.save()函数保存表格数据。该行有错误。并且控制不会进入下一行。Python - peewee - 调试语句 - 在哪里记录错误
只是想知道如何才能知道错误是什么。虽然我已经缩小到线如下
try:
with database.transaction():
driver = Driver()
driver.person = person
driver.qualification = form.getvalue('qualification')
driver.number = form.getvalue('phone')
driver.license = form.getvalue('issu')
driver.audited_by = 0
print "this line prints"
driver.save()
print "this one does not print"
print "Success"
except:
print "Error"
我已经用打印语句我能在该行driver.save找出错误的()。但是如何检查错误究竟是什么?
非常感谢! – Archer