I want to create a list of phone numbers from my message list using this Python script but am hung up on the 'from' attribute since it is a Python reserved word. Not sure what I am doing wrong. This script results in no numbers.
resp = platform.get('/restapi/v1.0/account/~/extension/~/message-store').json()
messList=resp.records
for i in messList:
try:
fromMess=getattr(i,'from')
fromMess=fromMess.phoneNumber
except:
fromMess='no number'
print(fromMess)