def clearfile(self):
try:
self.v = self.fileName.get()
with open(self.v, "w+") as w:
w.write("")
self.contents.insert(INSERT, "")
except:
messagebox.showwarning("file not found")