| Reply | « Previous Thread | Next Thread » |
|
I came across lots of people asking how to retrieve the Sender's number from a received SMS in Python even if the contact is in your contacts database.
Here is a quick fix: Code:
# Contact Number from Contacts dB
# XenoArts - John Robert Planta
import contacts #import contact db
db = contacts.open() #store in a variable "db"
def getSenderNum(sms_sender):
found = db.find(sms_sender) #find in database the contact name
try: found #check if found
except NameError:
senderData = found[0]
senderNum = senderData.find("mobile_number")[0].value
else:
senderNum = sms_sender
return senderNum
#now all you have to do is assign a variable the number of that contact name
mobileNum = getSenderNum(contactName)
#change contactName to whatever variable you stored your ripped contact
Good Luck.
Last edited by xenoflauge : 2007-08-30 at 01:16.
|
| xenoflauge |
| View Public Profile |
| Find all posts by xenoflauge |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| Retreiving the number of the sender of an sms | christee | Python | 1 | 2006-04-13 14:13 |
| How to get sms sender number? | cars2003 | General Symbian C++ | 1 | 2005-05-12 13:15 |
| how to email sms specifying a port number? | dukehoops | General Messaging | 2 | 2004-04-27 13:38 |
| when i get the sms how can know the number of sender | chinazou305 | Symbian Networking & Messaging | 3 | 2003-12-22 03:56 |
| How can I get the telephone number of the sender of an SMS? If i try get it | ask_expert | General Symbian C++ | 1 | 2002-05-10 19:56 |