using natty with deadsnake

I recently upgraded my Ubuntu from MaverickMeerkat to the new and improved version 11.04 named NattyNarwhal. Seeing that this was a clean install and I had to re-install a fresh development server I found myself at a loss with the older versions of my Python versions. To be able to effectively create applications on Google App Engine you will require Python2.5.

This you can install by referencing your Dead Snakes Repository as follows.
Edit your apt sources as follows:

$ gksudo gedit /etc/apt/sources.list

Add the following 2 lines to the bottom of the source list.

deb http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu natty main
deb-src http://ppa.launchpad.net/fkrull/deadsnakes/ubuntu natty main

Now update your apt repository and run the installation.

$ sudo apt-get update
$ sudo apt-get install python2.5

Now it should be safe to run GAE development server

$ python2.5 dev_appserver.py /path/to/your/app

Leave a Comment

Filed under Google App Engine

First step to enlightenment – Koans in Eclipse

Zen Koans have been around for ages. “Koans”- simply defined means disambiguate. In our context as developers it is usually a set of tests that encompass enough characteristics or uses of a language to learn the given language. The Ruby Koans are probably the best known and were also the first. The Koans for Python are available for download from GitHub.

Once downloaded you can follow the instructions on the GitHub site to run the Koans through the Python consile or if you are a GUI addict like me you can follow these steps to fire up Eclipse and run the test in sequence in a feature rich environment.

Eclipse Koans

Eclipse Koans

First step is to download Eclipse and get all the latest updates. Next requirement to get PyDev up and running is to add the Pydev update Url to your Eclipse updates. This you do by clicking on Help > Install new Software > Add.  Add the Url and run through the wizard.

This should be sufficient. If not you and you still experience problems, try installing Aptana Plugin for Eclipse. This would also enable Jython and IronPython editing in Eclipse bearing in mind that you have those compilers installed.

Awsome, once done you should have an “Intuitive” sence of how python works.

Leave a Comment

Filed under Intro, PyTest

IronPython – a primer

After downloading installing IronPython a good first read is a book by John Paul Muller “Professional Iron Python”. Iron python seems rock solid and is all the Python goodies built on top of the dot net framework, utilizing the DLR.(Dynamic Language Runtime) .

1 Comment

Filed under Intro, IronPython

import this

Isn’t it ironic how things pan out when you really get interested and involved in development as a whole?

I was as happy and content as a C# developer can be. Then a couple of months ago a fellow colleague, Gareth Stephenson, introduced me to the Ruby and Ruby on Rails world. Somehow I could not get used to the Ruby style of doing things and found it’s syntax kind of “sloppy”. Still like it though because the apparent sloppiness is probably the point of a dynamic language.

This then got me interested in the Linux environment and what the guys from the Mono project have been up to as far as porting and improving the .Net framework onto Linux. It was not until I came across Ubuntu’s free GIS offering named Quantum that I discovered Python and it’s application within the GIS community.  I was like a kid with lots of new toys….whooopy!

So to get to the point of this blog, I am still a junior when it comes to the “Snake” -Python that is, and I am going to share everything that I learn as I learn it with whoever want to do the same.

For a start go and get the latest version of Python from The Python HQ. You will most probably find everything there as far as upgrades, PEPS and happenings in the Python community.

Once you installed the Python command line, type “import this” and Enter. This will spit the following out:

  • 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!

Cool hey? Tim Peters you beauty!!!

Something to contemplate till next time.

Leave a Comment

Filed under Intro