Skip to content

How to write to a file in Python without deleting all content?

file = open("FILE_NAME.txt", "w+") # opens the file in both read and write mode
See also  How to delete a particular element from a list in Python?
, , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.