tweecode/twee — pull request #6 by mistydemeo (2013-02-03 04:00:23+00:00)
Title: Use __file__ as the basis for module search path

I had run into a problem that twee (and the other bins) couldn't find their module when called from symlinks rather than the actual binaries, since argv[0] didn't contain the actual path. In my case I'd installed twee to another location, then symlinked the binaries into /usr/local/bin.

Basing the path on __file__ instead ensures that the correct path will be found regardless of where the tool's invoked from.