Python 2.7

4 thoughts on “Python 2.7

  1. Wondering if there is somewhere a tutorial to describe the essential differences of Easy Script Python 2.7 versus older 1.5?

  2. Language wise there should not be many (if any) issues going to 2.7. You will however be able to write more neat code, for example:



       a = a + 1


       a += 1



       if a is 9:

          return "Nine"


          return "Not nine"


       return "Nine" if a is 9 else "Not nine"


    In short, you will be able to use modern Python. 


    Module wise the interpreter used in the 2.7 products is much more complete. You have sockets, threads, time, signal etc. You will get more from the interpreter and it will do what you want faster than 1.5 due to a lot of optimizations in the vanilla interpreter over the years.


    The custom modules from telit such as SER and MDM have changed slightly when it comes to the send/receive calls. It was no big deal to adapt to the 2.7 versions, but be aware that you need to tweak your code slightly when reading and writing data, and you might need to add small adaptor functions if you want code which runs on both 1.5 and 2.7. Again, nothing big.