Archive for the ‘python’ Category

Python + TAPI-madness

Monday, November 3rd, 2008

If it comes to lower- to medium-class telephony, TAPI is everywhere. Since Version 3.0 TAPI is okay, but even though controllable via COM, I was not able to use pythons win32com module to make it do what I want (here is a minimalized version of my problematic code).

Having TAPI availabe via python would be really, really nice, but all I could find in the internet, were a couple of other people wishing the same. So if anyone is willing to take the challenge, I’d be glad to help wherever I can.

I’ve got no idea if it would be easier to get TAPI3 working via win32com or to use CTypes to use earlier TAPI-revisions (which are really ugly).

Getting Birthdays out of the AppleAddressBook

Thursday, October 2nd, 2008

Recently I posted a terrible piece of AppleScript, but I refurbished the whole thing and rewrote it in python.

Basically there are two known ways of accessing the contents of the Apple AddressBook - well, two sane ways.

The first and most simple one is to use SQLite, and that will doubtlessly be the fastest way. But if Apple ever changes the data-schema of the addressbook the script will be useless. Apart from all that, there is another, more interesting way of accessing the addressbook - so I took the long way home *g*.

PyObjC offeres a neat bridge to OSxs’ native methods - these methods are useable in Python. Using pythons datetime classes it is pretty simple to accomplish almost anything concerning dates. This blog-entry was a great help and gave me the idea to use PyObjC - thanks!

Since my OSX does not offer a py2applet (and the macports version does not work properly) I used Platypus to bundle it into an App.

The Growl code I used stays BSD-licensed, my code is GPL3.

Have fun (and post improvements).

showbirthdays.app (clickable releaase)

birthdaystuff.tar.gz (sourcecode release)

Double- vs Single-Quotes

Thursday, August 7th, 2008

In Python, I just learned, they mean exactly the same (which is a terrible waste of semantic possibilities *g*).