class Tools(object):
@classmethod
def _exec_path(self,dir):
if dir:
return os.path.dirname(sys._getframe(1).f_code.co_filename)
else:
return sys._getframe(1).f_code.co_filename
tools = Tools()
pwd = partial(tools._exec_path,dir=True)