I am writing a Python program in TKinter on Ubuntu to import and print
the name of files from particular folder in Text widget.
It is just adding filenames to the previous filnames in the Text
widget, but I want to clear it first, then add a fresh list of filenames.
But I am struggling to clear the Text widget's previous list of
filenames.
Can someone please explain how to clear a Text widget?
Screenshoot and coding is giving below:
import os
from Tkinter import *
def viewFile():
path = os.path.expanduser("~/python")
for f in os.listdir(path):
tex.insert(END, f + "\n")
if __name__ == '__m