Pythonista3 is simply the most fun and easiest/fastest way to develop iPad/iPhone apps/demos (in Python) to complement your IoT demos and projects.
Apparently the app has been in the Apple Store for more than three years and the author has had time to refine the product and create quite a complete and powerful set of libraries including not only the usual “batteries” that come with Python, but also popular scientific libraries (such as Numpy and Matplotlib) and a set of brand new ones to support native iOS development.
The UI library for example wraps most of the Apple frameworks in such a Pythonic way that it becomes a real pleasure to use. Coupled with a (builtin) UI editor, it makes defining the user interface for an application a breeze, in stark contrast to the often frustrating experience of using Swift and the official XCODE tools. (Apple might even learn a thing or two from the nicely animated auto-layout helper features of the Pythonista UI editor).
Using the iPad Bluetooth LE interface, is an equally exhilarating experience. The documentation provided is well integrated with the IDE and the code examples are immediately usable and easily customised.
Just when I was starting to wonder if Apple had not lost its evil grip on the iOS toolchain (you can launch Pythonista scripts from the home screen, create extensions for other applications to call into, share data with the innermost parts of the OS), I run head first into one of the walls built to isolate this beautiful garden: getting code (scripts) in and out of an iPad is still quite a difficult proposition. Mind it is not impossible, using Dropbox and eventually by copying and pasting small bootstrapping scripts it is even possible to share your Python code on GitHub, it is just so much harder than it needs be or at least compared to the rest of the Pythonista experience. I guess some kind of a price they had to pay to let Apple feel still in control or at least to relegate Python to a much more limited role than the official toolchain?!
Regardless, this tool is a real life saver (as in “saving many hours of my life”). As much as I liked (mostly) learning Swift, I find Python to be much more effective, for my purposes at least. As a test, I have developed a UI for the IoT Sensor badge
The little (credit card sized) board comes with an Android app that connects to it via BLE but iPhone and iPad users were left out to dry. Here is a link to the GitHub repository for my interpretation of the UI (developed using Pythonista3).
More on the details of the solution in the next post(s).