anchor_python_utilities.file

Reading, writing or otherwise processing entities on the file-system.

Package Contents

Functions

path_same_directory(→ str)

A path to a file existing in the same directory as the executing script.

anchor_python_utilities.file.path_same_directory(path_file: str, filename: str) str[source]

A path to a file existing in the same directory as the executing script.

It is often convenient to call with __file__ as the first parameter, in order to locate a file on the file-system.

Parameters:
  • path_file – a path to the file that exists in some directory.

  • filename – the filename to assign in the outputted path.

Returns:

a path to a file with the directory of path_file with filename appended.