diff options
Diffstat (limited to 'examples/list_people.py')
-rwxr-xr-x | examples/list_people.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/list_people.py b/examples/list_people.py index f9f36b96..755de901 100755 --- a/examples/list_people.py +++ b/examples/list_people.py @@ -1,4 +1,4 @@ -#! /usr/bin/python +#! /usr/bin/env python # See README.txt for information and build instructions. @@ -7,13 +7,13 @@ import sys # Iterates though all people in the AddressBook and prints info about them. def ListPeople(address_book): - for person in address_book.person: + for person in address_book.people: print "Person ID:", person.id print " Name:", person.name - if person.HasField('email'): + if person.email != "": print " E-mail address:", person.email - for phone_number in person.phone: + for phone_number in person.phones: if phone_number.type == addressbook_pb2.Person.MOBILE: print " Mobile phone #:", elif phone_number.type == addressbook_pb2.Person.HOME: |