write_file
str, path: Path) write_file(string:
Write the string
to a file at the specified path
.
The parent folder of the file in path
must exist. If the file already exists, it will be overwritten.
Parameters
string : str
-
The content you want written to the file.
path : Path
-
The full path to the file you want to create, including the file name and extension.
Returns
Path
-
The path to the file that was created.
Raises
FileNotFoundError
-
If the parent folder of the file doesn’t exist.