with open("ファイルのパス","a") as f:
f.write('書き込み内容')
import codecs
f = codecs.open("ファイルのパス","w","utf-8")
f.write('書き込み内容')
f.close()
with open(path, 'r') as f:
text = f.read()
print(text)
import codecs
with codecs.open("ファイルのパス","r","utf-8") as f:
text = f.read()
print(text)
https://hydrocul.github.io/wiki/programming_languages_diff/io/file-type.html