Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Open Source > Python
|
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Python section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 9th, 2011, 07:30 AM
Registered User
 
Join Date: Nov 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default NEED HELP IN PYTHON CODE

this code is a part of function that make an array of received SMS's so you can read them and send a reply on them.
but it keeps entering the loop which is not what suppose to happen.

Anyone can help?

MDM.send('AT+CMGL="REC UNREAD"\r', 0)

smslist = ' '
res = ' '
timeout = MOD.secCounter() + 60
while ( (res.find('\r\nOK\r\n') == -1) and (MOD.secCounter() < timeout) ):
debugmsg('Timeout now: %d timeout: %d' % (MOD.secCounter(), timeout))
res = MDM.receive(50)
smslist = smslist + res
#debugmsg('get %s' % smslist)

MOD.sleep(1)#wait 0.1sec

smsparts = smslist.split('\r\n')

smspartslen = len(smsparts)

debugmsg('SMS Parts %d' % smspartslen)

smsmsgs = []





Similar Threads
Thread Thread Starter Forum Replies Last Post
Why Python? elvisfeverr Python 6 February 15th, 2019 02:30 AM
Python code optimization icopec Python 2 December 13th, 2011 05:13 AM
python? abilify BOOK: Ivor Horton's Beginning Visual C++ 2008 ISBN: 978-0-470-22590-5 1 January 27th, 2010 10:04 AM
python arafat.eajaz Other Programming Languages 0 July 18th, 2008 03:16 AM
RSS Code for python 2.5 (pyxml Vs 4Suite) dsampson BOOK: Beginning XML, 4th Ed ISBN: 978-0-470-11487-2 1 February 12th, 2008 10:49 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.