I have a folder path selected(in combo box1) and all the files in the path are displayed in listbox1(60+files) i will be selcting few files(2 to 3 files) from listbox1 and move them to listbox2. I have coded so far, now i need to read all the files from listbox2 and display their contents in excel . Someone please help me how to read all items in lstbox2 as a text files from already browsed path.
My code to populate combo box and listbox1:
Im using python 3.11 and looking forward to use openpyxl for the excel operations. Kindly help
def populate_combo1():
folder_selected = filedialog.askdirectory()
if folder_selected:
folder_path.set(folder_selected)
folder_contents = os.listdir(folder_selected)
list_box.delete(0, tk.END) # Clear the current list
for item in folder_contents:
list_box.insert(tk.END, item)