Category Archives: python

Indenting in PyDev

Mark the line, press TAB or Shift-TAB!

Posted in eclipse, python | Leave a comment

Counting PDF pages with python only

Found this recipe – nice and lightweight: import re rxcountpages = re.compile(r"$\s*/Type\s*/Page[/\s]", re.MULTILINE|re.DOTALL) def countPages(filename):     data = file(filename,"rb").read()     return len(rxcountpages.findall(data)) if __name__=="__main__":     print "Number of pages in PDF File:", countPages("test.pdf")

Posted in python | Leave a comment

Django Developer Toolbar

A really nice tool for everyone developing Django. Together with virtual-env, django-evolution, fabric, pip and pydev it’s a pretty nice development environment. Get it here. Well – pydev is currently living a dangerous life – spent my whole afternoon hunting … Continue reading

Posted in complaining, python, redirecting your attention | Leave a comment

.local is the Shit

… accidentally I stumbled about something I really wished for. User-specific site-packages (python-talk). As specified in “PEP 370 — Per user site-packages directory” a user’s home directory might now have a directory called .local which contains lib/python<version>/site-packages and also bin/. … Continue reading

Posted in MacOSx, linux, python, ubuntu | Leave a comment

Python + TAPI-madness

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 … Continue reading

Posted in python | Leave a comment

Getting Birthdays out of the AppleAddressBook

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 … Continue reading

Posted in MacOSx, project, python | Leave a comment

Double- vs Single-Quotes

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

Posted in python | Leave a comment