Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to empty a text file in python

file = open("sample.txt","r+")
file.truncate(0)
file.close()
 
PREVIOUS NEXT
Tagged: #empty #text #file #python
ADD COMMENT
Topic
Name
6+3 =