https://llego.dev/posts/writing-data-file-python-using-write-method/