Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Add email to contacts
-
Hi,
I am new to both Python and Pythonista. I am trying to create code to deduplicate contacts on iPhone.
However, I am not able to add email to Contacts.import contacts
people = contacts.get_all_people()
print people[0].full_name
people[0].email.append((u'$!<Other>!$', u'test@test.com'))
contacts.save()Why is this email not showing up in iPad Contacts?
Regards,
Dejan -
you have to re-assign the
email
attribute of thePerson
object. Modifying the list in-place has no effect, because thePerson
object cannot detect changes in that list (it's just a snapshot copy).Try something like this:
import contacts people = contacts.get_all_people() print people[0].full_name emails = people[0].email emails.append((u'$!<Other>!$', u'test@test.com')) people[0].email = emails # !!! contacts.save()
-
This post is deleted!