Python Training

We’re in that exciting period where we’re introducing a new language and new framework within IS Apps: we’re adopting Python with Django as our development platform of choice for web apps. Making such a significant change isn’t just about the technology or the underlying infrastructure but the people too, and means making a significant investment in developing our knowledge and skills.

To that end a group of intrepid developers and I have just undertaken the first of two training courses covering Python and Django.

The fipicture of the Python 3 Object-orientated Programming bookrst course, spanning the best part of four days, focused on Python itself and was based around the book Python 3 Object-orientated Programming from Packt Publishing. It’s rare that so many of us have the opportunity to take time out for training as a group (project commitments usually mean running smaller sessions) and it was great to get together as a team and learn from our very capable trainer Toby Dussek and each other.

We have a broad set of skills and experience across the teams in IS Apps with backgrounds in Java, C/C++, Coldfusion, PHP, SQL (the list goes on) and so the training was very much focused on “the Pythonic way”. Python is a very interesting language, designed from the ground up to enforce a certain structure and style and yet at the same time offers an amazing amount of flexibility in what (and how) you can build. I will admit to being challenged more than once while on the course on some long held views around object orientated best practices and how accessible Python makes your code – this is where you really appreciate the presence of your peers and the often lively but always insightful discussion that follows the “it does what?!” moment.

The course was also an opportunity to take some of the new tools we’ll be using for a test drive. We’re using JetBrain’s PyCharm as our IDE of choice and after a very happy and fruitful relationship with Sublime Text you could say I was nervous about dipping my toe back in the IDE water. Thankfully I needn’t have worried, PyCharm is a fantastic IDE and even the bells and whistles have bells and whistles, you could tell it’s been some time since I had used a full blown IDE when to my chagrin a colleague pointed out the integrated debugger as I was merrily debugging my code with print statements…

I think the stand out thing for me from the training was just how quickly we were able to go from introductory Python to much more complex code. It’s easy to see how Python facilitates rapid application development, particularly when coupled with a mature framework like Django and it will be exciting to see just what Django can do for us in the next round of training in a couple of weeks’ time.

Until then allow me to leave you with an interesting snippet of code which captures the ethos of Python development:

>>> import this

The Zen of Python, by Tim Peters

Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren’t special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one– and preferably only one –obvious way to do it.
Although that way may not be obvious at first unless you’re Dutch.
Now is better than never.
Although never is often better than *right* now.
If the implementation is hard to explain, it’s a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea — let’s do more of those!