Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

PyS60 - ListSMS To File.txt

DZone's Guide to

PyS60 - ListSMS To File.txt

·
Free Resource
// Salva la lista degli SMS in un file


from time import ctime

import codecs
import inbox

box = inbox.Inbox()
msg = box.sms_messages()

f = codecs.open('E:/Others/listSMS.txt', 'w', 'utf8') # Apre il file in codifica UTF8
for i in msg:
	f.write(box.address(i))
	f.write('\n')
	f.write(ctime(box.time(i))) # Converte i secondi in una stringa rappresentante il tempo
	f.write('\n')
	f.write(box.content(i))
	f.write('\n')
f.close()

print 'Fine'

f = codecs.open('E:/Others/listSMS.txt', 'r', 'utf8')
print f.read()
f.close()
Topics:

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}