Well, we’ve come to the conclusion of our Secondary Pythonista series. “Evaluating the End Product” is the title, but if you’ve been following along at home, you know our script is not complete. In the first part of this article we’ll finalize the script. In the second part we’ll review what we’ve done through this series, and where we could go with our little script.
In our last Secondary Pythonista article we covered a lot of good ground. We went from no written code to a working script which collects ids corresponding to the articles we’re looking to compile. And it’s all been with less than 30 lines of code. Pretty fantastic.
But we still have a ways to go before we can consider our script even remotely “finished”. Today we’ll start harvesting the output we want to compile, storing it in the best manner possible to be retrieved later, all with a view towards final output.
Welcome to the fourth installment of Secondary Pythonista. After careful consideration and research over the last two articles we now have a project brief, a plan of attack, and have chosen the tools we’ll need to execute on that plan.
In this article, using the information we’ve compiled previously, we’ll begin executing on those plans. We’ll begin writing code in Pythonista. As we do that, the value of all the pre-work that we did will become quickly apparent. There’s a strong temptation to dive head-first into writing code, but the careful and methodical approach we’ve gone with for this tutorial as many benefits, including giving you, dear reader, a better understanding of the why we’re programming a certain way in addition to the how to program in that manner.
So let’s get to it!
Hopefully you’ve been keeping pace with our new Secondary Pythonista series. In our last article we were presented with the project brief for our script. This kind of brief, some sort of starting point, is essential to creating a good script. Without a sense of direction, without a clear goal in mind, the script will be aimless, essentially useless, and may never end up being completed to any functional degree.
Programming languages are practical tools used to solve real-life problems. So naturally, the best way to learn a programming language — and by extension a programming utility like Pythonista — is by solving a real-life problem with it. That’s what we’re going to do here in Secondary Python, take an idea for a program, something that solves a problem, and then use Python and Pythonista to build a solution to that problem.
So without further ado, lets examine the project brief.
We’re back! As promised at the conclusion of Pythonista 101, we’re back with a new series detailing Pythonista and the process of building useful utilities in the Python language.
Before you’re introduced to the course material for Secondary Pythonista, let us briefly review what was covered in Pythonista 101.
In the last Pythonista 101 article we discussed modules. Modules are Python scripts that come bundled with Pythonista giving us access to new and interesting features. Because of the sandboxed nature of iOS, what comes bundled in with apps like Pythonista is really all that we have to work with. When compared with the free reign found on Mac OS X, Linux, and even Windows, this may seem restrictive. Fortunately the developers of Pythonista have done a fantastic job packing as many modules into Pythonista as possible. Today we’re going to look over some more, as well as examine some real-world scenarios that Pythonista could assist with.
If you’ve been with us since the beginning of Pythonista 101, you know that we’ve covered quite a bit of ground. Going from simply installing the app, navigating around the potentially intimidating interface, and even installing some scripts we found on the web. Then we graduated to breaking down those scripts we found, and making some modifications to them.
Well now it’s time to graduate even further, and look at where the real power and potential in Pythonista comes from: modules.
After the last article you should now be familiar with the Pythonista app as well as the eager community of developers which support it. While we did create a new script and learn how to import other scripts into Pythonista, we didn’t actually write any Python code. And while we won’t be writing any scripts from scratch this time, we will be learning how to read a Python program, as well as to modify certain aspects of it to add functionality or make it our own.
A real asset to Pythonista is the enthusiastic developer community that’s sprung up around the app. The Pythonista Forums are a rich source of support when struggling to debug a script of your own, or when looking to release a script for use by the rest of the Pythonista community.
As it has become a common place to post Pythonista scripts, we’ll be showing off a few select examples found in the Pythonista forums to help give you an idea of the sort of thing Pythonista is capable of. We’ll also explain how to integrate a script from the web into your copy of Pythonista.