So i have a tuple with this structure:
tuple = ('Art School', 'Berlin', 'John Morgan(School1-Ge/Berlin);Andrew Martin (School1-IT/Roma); Tom Jones(School1-USA/Chicago)')
Each person structure it's like this :
John,Morgan(School name-Country-GE/City-Berlin)
I need to get every person email address and for this i'm using a function where i sent the name of the person as a parameter.
def get_email_address(name):
if name is not '':
try:
sql = sql1%name
cur.execute(sql)
except Exception as e :
print()
txt = str(cur.fetchone())
email = txt[2:len(txt)-3]
return email
return ''
where sql1="""select MAIL from email_table where NAME= '%s'"""
and NAME = tuple[2]
When there is only one person in tuple[2] is working fine ,but when the number increase i only get the last person email address.
My question is how to send all values from the tuple[2] to the email function to get all persons email address?