Captured: 2015-09-29 at 00:08 from ipad.appstorm.net
Welcome students.
Over the next three weeks you'll go from being Python novices to Pythonistas. You'll be learning how to use the app Pythonista to leverage the power of the Python programming language and expand what you previously thought possible using iOS.
Before we dive into what Pythonista is, why it's interesting, and what we'll cover in this series, let me explain a bit about Python, the programming language Pythonista uses.
Like this article? Stay up to date with the latest changes by subscribing to our RSS feed or by following us either on Twitter, Facebook, Google+ or App.net.
Python bills itself as a programming language that lets you work more quickly and efficiently than other languages out there. And while speed and efficiency with a language can vary from person to person, I think they can make that statement with some authority. Python is fast and efficient -- making it a good starting point for the beginner programmer.
Another key aspect of Python that makes it easier to learn than other common languages is that it is a high-level language, meaning it abstracts a lot of lower-level, machine-specific code from the programmer. High-level languages focus instead on programming techniques and constructs that are easy to write, understand, and debug.
Something else important about Python has more to do with the community than the language itself. Python programmers emphasize code readability ahead of cleverness. If some piece of code is clever or novel but indecipherable or impossible to debug, it's considered bad practice. Python as a language is effected by this philosophy, in that whitespace in Python is mandatory. That right there tends to make some programmers edgy, but personally I like it. I want readable, maintainable code. So I would put the whitespace in there anyway. In the case of Python, the language aids in reminding me what whitespace needs to go where. For me it's a feature, for others it may feel more like a bug.
If this feels a little simple and not detailed enough, please bear with me. We'll be diving more into Python as a language as this series progresses. The best way to learn any programming language is by using it. For now I hope this gives you a basic understanding of the type of language Python is, one designed to be simple and efficient, easy to write and even easier to read.
Now we come to Pythonista. The app is essentially a Python IDE (integrated development environment) for iOS. That may be a simple definition, but it's an impressive accomplishment. Critics have claimed that iOS, and the iPad in particular, are for consuming content, not creating it. _Pythonista _ flies in the face of such thoughts. And I think it proves them wrong. Bringing the power of a full programming language to iOS is excitingly powerful, as we'll see through the rest of this series.
Let's take a quick tour through the Pythonista interface.
The main view of Pythonista
This is the main Pythonista interface. On the left we have the Card Stack, a scrolling list of your Python scripts. On the right is the editor. Right now it gives us a preview of the code for the selected script. But tapping on it or sliding from right to left will bring the Editor into full view.
Pythonista's Toolbar
Now that we've swiped right to left and brought the Editor View into focus let me explain the buttons you see across the top of the screen.
- This slides the Card Stack list of scripts back in.
- Brings up the settings for the Editor. We'll explore this more in-depth later on.
- Fades in a search box letting look for text within the open script.
- Opens the Pythonista Documentation. Very useful. Sections of this will appear as homework later on in the series.
- Offers us export options for the script we're looking at. We'll also look at this in more depth later on.
- Executes our script.
One other piece of Pythonista's interface that we'll look at is triggered by swiping right to left on this little button here:
The Interpreter Handle
This brings up the Python Interpreter. A command-line interface, whatever you enter into the text field, will be run as Python code.
The Interpreter View
This is a nice way to play around with Python. A lot the examples you'll find online are designed to be run within a Python Interpreter. Some things within this series will be as well. So try playing around with it - getting familiar with how to write simple lines of Python code.
OK, so now that you know what Python and Pythonista are, what exactly is Pythonista 101 going to be all about?
Pythonista 101 is designed to take you from no real knowledge of either Python or Pythonista and set you up with a working knowledge of both. If you're new to programming try not to worry, we're doing our best to keep this as simple and easy to understand as possible. Just like a well written Python script.
The series breaks down like this:
- The Scripting Community - A big part of Python's popularity lies in the community itself. The same is true of Pythonista. There's a rich community offering pre-made scripts designed to run in Pythonista. We'll look at that community, some of the scripts offered, and how you can get your hands on them.
- Python Wrangling - Once you're familiar with Python scripts and how to get them onto your iPad and into Pythonista, we'll get our hands dirty with writing some actual Python code. First modifying some pre-existing scripts, and then onto building a simple script of our own.
- Building Blocks - Finally we'll take an in-depth look at all the Python modules that come with Pythonista, giving you a good understanding of the tools at your disposal as we let you loose to code your own creations.
So if this series piques your interest get ready for the first lesson, coming up this Friday!