I am still confused in the way of writting a python code as i am used to java codes with brakets and i cant fully understand the indentation concept. So this is a code that produces a syntax error so any one can help please ? Thank You in advance
def SendSMS2 (phone_number,sms_text):
print 'made it to def'
res = MDM.send('AT+CMGS='+ phone_number + '\r',5)
n=0
while n < 20:
res=MDM.receive(1)
if res.find(">") >-1:
print n
break
else:
n = n +1
res = MDM.send(sms_text, 10)
if res != -1:
print 'Text sent ok'
res = MDM.sendbyte(0x1a,10)
n=0
while n < 20:
res=MDM.receive(1)
if res.find("+CMGS") >-1:
print n
break
if res.find("ERROR")>-1:
print 'sms ok'
else:
print 'not good'
else:
n = n +1
print 'def completed *******************'