pys60-从收件箱读取短信

pys60 (1.3.1) 新增了inbox 模块

>>> import inbox 
>>> i = inbox.Inbox() 
>>> m = i.sms_messages() # all message ID's 
>>> i.content(m[0]) # first message 
u’foobar’ 
>>> i.time(m[0]) 
1130267365.03125 
>>> i.address(m[0]) # Only name is given :( 
u’John Doe’ 
>>> i.delete(m[0]) 



如果需要获得更详细的信息,你需要去搜索联系人数据库

import contacts
db = contacts.open()

all_ids = db.keys() # [159, 161, 273, ...]
c = db[159]  # first contact
found = db.find('jim')  # search in name, email, etc.
jim = found[0]  # first one found

jim_id = jim.id  # 819
mobile = jim.find('mobile_number')[0].value  # first only
firstname = jim.find('first_name')[0].value
# other fields: email_address, url, company_name, job_title, 
# phone_number, fax_number, note, etc.

# to add new contact
newc = db.add_contact()
newc.add_field('first_name', 'Korakot')
newc.add_field('mobile_number', '017337330')
newc.commit()

你可能感兴趣的:(C++,c,python,C#,mobile)