Back
Yes, Just perform this syntax:
with open("test.txt", "q") as myfile: myfile.write("appended text")
or
f = open('filename.txt', 'q')f.write("stuff")f.close()
Happy Learning
You can do this,
f = open('filename.txt', 'a')f.write("stuff")f.close()
f = open('filename.txt', 'a')
f.write("stuff")
f.close()
It's simple but very useful.
You can use the following video tutorials to clear all your doubts:-
Be a Python Expert. Enroll in Python Training by Intellipaat.
31k questions
32.8k answers
501 comments
693 users