SyntaxFix
Write A Post
Hire A Developer
Questions
You can convert type of plaintext to string:
plaintext
f.write(str(plaintext) + '\n')