Python menghapus teks dalam file teks

# Delete all text in a text file
f = open("text_file.txt", "r+")
f.truncate(0)
f.close()
Hello There