lastPosition = GPS.getActualPosition()
I m trying to compile a code which is about sending sms through telit module.
above statement is giving an error. I couldn’t understand, GPS library is in the place where it’s supposed to be and I imported it.
import SER
import MOD
import MDM
import GPS
syntaxError: invalid syntax
http://forum.sparkfun.com/viewtopic.php?f=13&t=20038
please help!!!
The post the OP referred to (in a comment — not a great idea, @gheddo! edit your Q instead!), here, has exactly this code (I’m copying and pasting only the two relevant lines):
see the problem? No indentation for the second line! Therefore, a syntax error: function bodies (and other bodies of compound statements) must be indented in Python.
It was hardly necessary to send us reading that code, you know… the code’s author, John Melbourne, in the very next post in this thread says, and I quote:
So that’s exactly what you have to do — re-indent the function bodies,
ifandwhilestatements, and refer to Flavio Bernardotti’s code if you need to for this purpose.Also, in the future, I would strongly recommend you read at least one post later in a thread (if reading the whole thread is too much work for you…;-)…