On Mon, 05 Jan 2009 17:54:19 -0500, Terry Reedy
wrote:
>> for email in rows:
>> To = email
Thanks guys. Turns out email is a tuple, so here's how to extract the
columns:
for email in rows:
email=email[0]
--
http://mail.python.org/mailman/listinfo/python-list
il
#print To
#(u'du...@acme.com',)
Why are these line comments?
Why is the string enclosed in a tuple?
#AttributeError: 'tuple' object has no attribute 'lstrip'
True. Only strings have lstrip method.
#server.sendmail(From,[To],msg.as_string(
te(sql))
> for email in rows:
> To = email
> msg['To'] = email
>
> #print To
> #(u'du...@acme.com',)
That looks like a tuple to me. What does it look like to you?
>
> #AttributeError: 'tuple' object ha
list(cursor.execute(sql))
> for email in rows:
>To = email
>msg['To'] = email
>
>#print To
>#(u'du...@acme.com',)
>
>#AttributeError: 'tuple' object has no attribute 'lstrip'
>#ser
ver = smtplib.SMTP("smtp.acme.com")
sql="SELECT email FROM people WHERE email IS NOT NULL"
rows=list(cursor.execute(sql))
for email in rows:
To = email
msg['To'] = email
#print To
#(u'du...@acme.com',)
#Attribute