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