I've been using this:
import inspect
import os
class DummyClass: pass
print os.path.dirname(os.path.abspath(inspect.getsourcefile(DummyClass))
(Edit: This is a "where am I" function - it returns the directory containing the current module. I'm not quite sure if that's what you want).