So leeren Sie eine Textdatei in Python
file = open("sample.txt","r+")
file.truncate(0)
file.close()
Galvik Codex
file = open("sample.txt","r+")
file.truncate(0)
file.close()
open('file.txt', 'w').close()