File Interaction

ornithology.write_file(path, text, permissions=511)[source]

Write the given text to a new file at the given path, stomping anything that might exist there.

Parameters:
  • path (Path) – The path to write to.

  • text (str) – The text to write.

  • permissions (int) – The permissions to give the file.

Returns:

path – The path the file was written to (as an absolute path).

Return type:

pathlib.Path