Membersihkan semua teks dari file dalam python
fileVariable = open('textDocName.txt', 'r+')
fileVariable.truncate(0)
fileVariable.close()
Envious Emu
fileVariable = open('textDocName.txt', 'r+')
fileVariable.truncate(0)
fileVariable.close()
f = open('file.txt', 'r+')
f.truncate(0) # need '0' when using r+