Home » Internet Goodness, Linux Administration, Python

A case for learning python

2 May 2007 No Comment


Disclaimer: I am not a programmer ;)

In my last entry, I had a dig at Microsoft’s Silverlight for not being cross-platform and referenced python as an example of a truly cross-platform language. I’ve been wanting to collect many of my thoughts and research on the topic and want to put it all together in a place I can reference.

First up: Why Python and / or it’s derivatives

It’s Cross-Platform – truly

I am a Systems Administrator, with an equal share of my day spent between different *nix varieties & Windows. When I first set out to learn a linux editor, an old Solaris admin suggested I spent time to learn vi.. as it was the lowest common denominator when jumping between different *nix platforms. I applaud him for that advice now as it’s a rather big time investment learning vi.

So, it’s a similar thing with Python for me.. in the *nix world, Python is there by default on most and if it’s not there, it’s usually in an easy to install package – even HP-UX ;)

In Windows, it’s a 14mb installation, a no brainer also. I am not a heavy Mac user there’s a Universal available for  Mac’s as well so, I would imagine it’s also a no-brainer.

It’s Got Swiss Army Knife Capabilities – all for free

  • Want to build “platform native-looking” cross-platform gui apps with ease – check out wxpython
  • Want a cool, agile, mvc platform for web-development – check out Django or Turbogears
  • Want a powerful, flexible python-based CMS – check out Plone
  • Plone is built on a Python Application Server called Zope
  • Want an event-driven networking engine – check out Twisted
  • Want to access Active Directory via python, Tim Golden has some excellent scripts.
  • Want to monitor Linux and Windows machines in your network – check out Zenoss
  • Want a brilliant Music player for your Linux Machine – check out Listen Project
  • Want some python recipes to whet your palate – checkout O’Reilly Python Recipes
  • Want some IDE goodness for your applications – check out SPE, Pydev or Eric
  • Want to learn python – checkout diveintopython, How to think like a computer scientist
  • Want to watch some python screencasts – check out Bestechvideos or Showmedo
  • Want to control windows gui apps for QA testing or just for the heck of it – check out pywinauto
  • If any of the above don’t quite fit your needs – you can easily modify them to as they’re all open source.
  • Check out what python libraries are available (2345 as of this writing) – Go see the cheeseshop
  • It’s terse, concise and easy to read

but wait, there’s more…

  • Want to access any Java class from python – check out Jython
  • Want to access the win32 api – check out Win32 Extensions
  • Want Python for .Net – yes, you can access C# or VB.net CLR classes with Ironpython

Python’s derivatives – Boo (using mono) and Groovy
Python’s so good, some people decided it was worth copying (adding) to for their own personal preferences. So, if you’re a C#  programmer, who needs your compile-time errors you could check out Boo and you can even convert your VB.net or C# projects to Boo using Sharpdevelop for Windows. I’m not sure if Monodevelop for Linux will convert C#<->Boo<->VB.net but it pretty much covers everything that Sharpdevelop does albeit that the GUI Designer utilises GTK# rather than WinForms for developing interfaces.

I built a quick GUI with a few menus in Sharpdevelop in Boo and compiled on Windows. Copied the .exe and dll’s across to Linux..sweet. It ran and even resembled a .Net application on Windows XP.

Ironpython is also running on Linux under Mono and can use WinForms if you choose.

For those who are looking for “more Java than python” but need to give their wrists a break, the Boo equivalent for Java is Groovy – An agile dynamic language for the Java Platform

With python, you can extend Java programs without learning Java, extend .Net programs without learning .Net so it ultimately provides you a lot more agility as a programmer (me thinks) than being stuck in one or the other camps.

To finish the entry off – I figured it’s well worth quoting the famous 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!

Technorati Tags: , , , , , ,

Powered by ScribeFire.

Leave your response!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.