Getting the current filename

Under Blender210 module there is a function getFilename().

How do you do that under the current API? Blender210 is no longer available under 2.25.

Actually, I just want the path of the current file, if that’s easier.

Bob


import Blender, os

file = Blender.Get('filename')
t = os.path.split(file)
path = t[0]

or in a single line:


path = os.path.split(Blender.Get('filename'))[0]