def dirname(filename): from os import path return path.dirname(filename)