Wednesday, November 7, 2007

Why do I like Python...

by Mukul Dharwadkar
A quick take on my growing fascination and liking on Python (The programming language, not the reptile)...
I am not the programmer types. Let me be very clear and candid. Although I like to dabble into programming a lot. I have tried C programming, Perl programming, HTML programming, a little bit of VB programming (a lot really. In fact I can write applications in VBA for excel). But none of the languages caught my fancy for too long. Of course I did not master any of them, but know just about enough to read the programme without asking for help and understand what's going on in the programme.

I took on Python as a supplementary skills required for me to build this website effectively. Partly I have been attracted to Python for the fact that almost every internet company runs on it, it claims to give unprecedented programmer productivity and the most important factor; Plone(R) - the software on which this website runs is built with Plone. So if I had to make full use of Plone and the features it provides and customise my website to its fullest, then I have to learn Plone.

I set out looking for internet based tutorials and soon realised that it is a very interesting language and very easy to learn too. But I also realised that online tutorials are probably not going to help me a lot. So I looked around for a book for beginners (I always like to start at the very beginning, regardless of how much I know already) and found a good book. I am working on it and am done with the basics of it and I can already tell that it is very easy, very programmer friendly and gives a great way to improve your programming experience. I can say this based on my experience with C. The interactive session is a great way to test out ideas and concepts before you code it fully and then have to rework it. The interactive session lets you test and iron out your ideas and saves a lot of rework.

Also, having a immediate response on whether your idea is going to work or not is always a good idea (almost). I have written some basic programmes and I will be developing some applications as soon as I get some level of comfort and can crystallise my ideas better. I will post those programmes here for review and use by anyone under my own personal open source license (which will allow anyone to do anything for free, with a few caveats (not related to money of course) of my own. I think it will be good for the programming community all in all.

Let me know if you have ideas on creating any programmes or applications and I can give it a try. Also let me know if you have any ideas on the open-source licensing. What would you like it to be? What caveats can you work with?

Friday, September 7, 2007

Romantic love poem in Python

...

if you in (depressed, sadness, resignation):
print 'me, my sweetheart'
if feel(you) is 'lonely' or feel(you) is 'neglected':
talk_me(this)
while always:
I.take_care(you)
if you.love() is not me:
# I will follow in the madness
# I will
break # down...
for emotion in my.heart:
try:
your.lover = me
except:
your.best_friend = me
if you.hate(me):
love(me)
elif I.annoying():
love(me)
else:
love(me, how='deeply', when='now')

...


Binding

Simon Edwards kicked off the Bindings track (which ran alongside the KDE 4 Pillars track, often resulting in a difficult choice for attendees!), describing the process of creating KDE applications in Python. He started with Python and its features, but as many attending the talk were Python veterans, he quickly continued to talk about his own involvement. Simon worked with C++ for a long time, but never was too happy with it. When he discovered Python, he immediately fell in love. For him, the binding of Qt/KDE and Python is a 'match made in heaven'. He started developing system configuration tools for Kubuntu. He showed how similar the Python-Qt-code is to C++. The bindings form a glue between the typical C++ syntax and the Python one, yet preserving many of the cool Qt features. Yet it is very efficient to program, and the performance overhead is very small due to the use of the Qt and kdelibs for the heavy lifting. Painting is delegated to the Qt libs, yet it is possible to subclass a C++ routine, and modify it. The biggest disadvantage is the memory usage of the python interpreter, but this can be shared between all Python processes.
Next, Simon progressed to the 'cool stuff', showing how to embed a Python application in the C++ based KControl. He expects KDE 4 Python bindings to keep up with KDE development, releasing a beta alongside KDE. Then he talked about the nice side-effects the Python work brings, like faster development, better debugging information and a lower barrier to contribution. According to Simon, PyQT and PyKDE bindings bring the fun back into development.

After the talk by Simon, one our youngest members paired with one of our more seasoned hackers to give a talk about their work on the C# bindings. We will cover thisthis in a later article (an interview is planned) so you'll hear about it!