Situation: I wanted to open a file for reading, then write at a certain place in the file.
Problem: Couldn't read and write even with
f = open('myFilename.txt', 'r+')
Solution: After reading, can't simply do f.write.
Instead,
f.seek()
then,
f.write('My writing')
Solution: After reading, can't simply do f.write.
Instead,
f.seek(
then,
f.write('My writing')
No comments:
Post a Comment
So, what did you think?