Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

files python

with open("filename.txt", "w") as file:
  file.write("new line in new/now cleared document")
with open("filename.txt", "a") as file:
  file.write("This line is added to the now 2 line document")
with open("filename.txt", "r") as file:
  lines = file.readlines() # ["new line in new/now cleared document
", "This...
Source by docs.python.org #
 
PREVIOUS NEXT
Tagged: #files #python
ADD COMMENT
Topic
Name
7+9 =