1
used_emails = [row.email for row
in db.execute(select([halo4.c.email], halo4.c.email!=''))]
返回:
['[email protected]', '[email protected]', '[email protected]', '[email protected]', '[email protected]']
我用它来寻找匹配:
if recipient in used_emails:
如果找到匹配我需要从同一行的数据库中拉出另一个字段(halo4.c.code)。有关如何做到这一点的任何建议?
似乎是个好主意。它出错了,并说'[row.email:'中的':'是'SyntaxError:invalid syntax'。 –
这是与'['而不是'{'。当我将其切换回你提示的方式时,它说'row for'中的'for'是'SyntaxError:invalid syntax' –
@DavidNeudorfer Python 2.6有什么可能吗?我会更新一些与之相关的东西。 – RocketDonkey