Find a number from the contacts list

Description:

This example shows how to retrieve a number of a contact and call it. Three modules are used: appuifw, contacts and telephone.

###################################################
#Python examples for AAU Mobile Phone Programming #
#(c) Mobile Phone Group #
###################################################

#remember to insert the contacts using the mobile_number field

from appuifw import *
from telephone import *
import contacts

db=contacts.open()
entry =db.find(query(u'Insert the name','text'))
L=[]
for item in entry:
L.append(item.title)
if len(L)>0:
index = selection_list(choices=L , search_field=0)
num=entry[index].find('mobile_number')[0].value
dial(num)
else:
note(u'No matches','error')

Download:

ex3.py

Output:

 The following screenshots are the outcome. Just click on the icons to enlarge them for a better view.

Output

Department of Electronic Systems | Aalborg University | Niels Jernes Vej 12 | DK-9220 Aalborg | Denmark
Phone: (+45) 9635 8695 | Fax (+45) 9815 1583 | E-mail ies(at)ies.aau.dk
Copyright © 2006 Department of Electronic Systems

Last update:23-04-2008