Archived:How to make a phone call using PySymbian
Aquivado: Este artigo foi arquivado, pois o conteúdo não é mais considerado relevante para se criar soluções comerciais atuais. Se você achar que este artigo ainda é importante, inclua o template {{ForArchiveReview|escreva a sua justificativa}}.
Acredita-se que este artigo ainda seja válido no contexto original (quando ele foi escrito)
Acredita-se que este artigo ainda seja válido no contexto original (quando ele foi escrito)
Article Metadata
Tested with
Devices(s): Nokia N95, Nokia E90
Compatibility
Platform(s): S60 1st Edition, S60 2nd Edition, S60 3rd Edition
Article
Keywords: telephone
Created: cyke64
(15 Mar 2007)
Last edited: hamishwillee
(31 May 2013)
Contents |
Overview
This snippet shows how to dial and hang up a call in Python.
Source code
import appuifw, e32, telephone
app_lock = e32.Ao_lock()
#Define the exit function
def quit():
#Cancel the timer when the user exits, if it has not expired
t.cancel()
app_lock.signal()
appuifw.app.exit_key_handler = quit
number = "072xxxxxxx"
#The number to be called
#Dial the number
telephone.dial(number)
#Instantiate a timer
t = e32.Ao_timer()
#Let it ring for 10 seconds and then hang up
t.after(10, lambda:telephone.hang_up())
#Wait for the user to request the exit
app_lock.wait()
Postconditions
A call is made to the specified number. The call will last for 10 seconds and will then be hung up.
Additional information
The contacts module can be used for retrieving numbers.


26 Sep
2009