Clear Contents of a File using Python

open function with write mode

file = open('test.txt', 'w')
file.close()

Leave a Comment

Cancel reply

Your email address will not be published.