8th
Workaround for PyS60: Sending SMS in a loop
It isn’t possible to send SMS in an iteration in PyS60 since the messaging.sms_send() will raise an error if the previous SMS isn’t sent (or failed to send). The PyS60 docs say that the state of the previous SMS can be determined by using the callback function as an argument in messaging.sms_send() and then checking the state of the SMS by testing with messaging.ESent, messaging.ESendFailed and other messaging.E* states.
When you want to send SMSes repeatedly in an iteration you’re stuck when it comes to determining whether the previous has been sent. So here’s a quick and easy workaround.
Use the try-except to detect errors and loop until the previous SMS has been sent.
My Bookmarks