os.path.dirname(path)
[
^] is a function that will return the path to a file where the parameter given is the complete path including the file and an optional extension.
__file__
(see here for instance:
http://docs.python.org/library/runpy.html[
^]) is a special global variable that will give the file name of the file that contains the momentarily executed code. So if you use this variable in your code it will give you the file name that contains the instructions you wrote.
So the construct in question will give you the path only of the file containing the momentarily executed instructions.
Regards,
Manfred