Jak opróżnić plik tekstowy w 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()