Launch all the Pythons!
- If you own an iPhone, read on!
- If you like making your phone twice as epic as it originally ships from Cupertino, read on!
- If you enjoy programming, read on!
- If you have even the teensiest interest in programming, read on!
Now at this point, if you’re saying “Jonathan, I don’t have an iPhone, and I hate anything that goes ‘1011001010001’ then please stop reading right now and instead check out this adorable video of baby pandas.
A little while back, I found myself with a problem to which I needed to find a solution. If you’re still reading, you can relate. If you’re not still reading, I hope you’re enjoying those pandas, but I still think you can relate.
I was doing my senior physics research project and was needing to recruit subjects to test a game that I had made. To be an ethical researcher, and in order to protect their privacy, I needed to dissociate their responses from their identities. To do this, I needed to generate a code for my test subjects, give it to them, and then store that code somewhere where I could access it while compiling my results.
Now, doing all this isn’t all that hard. The trick is doing this simple process 30 times in the course of two days, sometimes while a bunch of people need to run off to class, and you have 45 seconds to get all their codes generated, shared, and stored.
The folks over at Asian Efficiency practice a habit called the 3 times rule: Anything task that you do more than 3 times should have a system to it, and if you can automate it, all the better.
Here is where the iPhone that’s twice as awesome as Cupertino ships thanks to your teensy+ interest in coding comes in. There are two apps that I used during this time to make my life heaps easier. The first is called “Launch Center Pro” (or LCP for short) and the second is called “Pythonista.”
Launch Center Pro
Think of LCP as a place where you can make whatever “big red buttons” you want. These “big red buttons” are there on your phone right inside of either the LCP app, your Today widget, or if you’re really clever, on your home screen. When you tap this big red button, you’re phone blasts off to start a task that you might have otherwise gotten distracted along the way only to think after 45 minutes of scrolling, “Uhh…why did I open Facebook again?”
I use LCP to
- Text my wife cute little notes here and there (some of them are even pre-programmed, such as a heart, miss you, and “see you soon”)
- Post a tweet to twitter without getting distracted by my feed
- Scan QR codes
- Open my bluetooth settings right to the display where I can pair with a device, rather than weaving through menus.
- Quick-launch a Pythonista script (more below).
On the other hand, Pythonista is Python on your iPhone. It’s the editor and the interpreter, and you’re window into one of the best languages to start coding. If you’ve wanted to code, but are always on the run and away from your computer, typing out a few lines here and there on your phone may be the solution. I prototyped one of my senior research games on my iPhone using Pythonista.
Pythonista gives you under-the-hood access to so many features. And it’s developer, Ole Zorn is always adding new features to the [already extensive list]. To name a few really clever ideas you can script in Pythonista:
- Remind yourself to send a text message in 6 hours using the notifications library.
- Turn your phone into a morse code strobe light using the flashlight Objective C library.
- Perform robust image manipulation on your phone
- Generate beautiful (3D!) mathematical plots using data you capture from your phone’s accelerometer, camera, or manual input.
The list goes on. There is a rich community of enthusiasts over at
So here is where the magic comes together. LCP isn’t all that great at functionality. It’s just really good at kicking other things off. Pythonista is like this Swiss Army Knife with 100 tools on it, but they’re all power tools – but it’s a little clunky to launch.
Marry these two and you have a great way to handle these scriptable problems such as generating codes for research participants that I mentioned earlier.
If you want to create new functionalities for your iPhone that you didn’t think you could, I would highly recommend these two apps together. They are awesome complements other power-user apps such as Workflow and Drafts4.
If you’re not into automation and scripting, but are still interested in learning to program in Python, I would even recommend buying Pythonista by itself just for having a mobile python environment to fiddle around with. The best thing is that two days ago (at the time of this posting), Ole Zorn released Pythonista 3, and for a limited time is offering a 50% discount, so you can grab it for $5. There’s no better time to try it out!