fileVariable = open('textDocName.txt', 'r+') fileVariable.truncate(0) fileVariable.close()
file = open("sample.txt","r+") file.truncate(0) file.close()