Borrar todo el texto de un archivo en Python
fileVariable = open('textDocName.txt', 'r+')
fileVariable.truncate(0)
fileVariable.close()
Envious Emu
fileVariable = open('textDocName.txt', 'r+')
fileVariable.truncate(0)
fileVariable.close()
file = open("sample.txt","r+")
file.truncate(0)
file.close()