Path.write_text#

Path.write_text(data, encoding=None, errors=None, newline=None)#

Open the file in text mode, write to it, and close the file.