title: get absolute path of file without filename using Python pathlib
body: <p>I want to replace <code>file_location = os.path.abspath(os.path.dirname(__file__))</code>
  with <code>pathlib</code> to get the aboslute path of the file without the filename
  <br>
  with using  <code>directorypath = pathlib.Path(__file__).resolve()</code>
  gives me the absolute path + the filename
  <br>
  how can I get the absolute path without the filename ?</p>