Nov-29-2017, 10:49 AM


currently I am trying to use "all_data.append" to append all xlsx files into one file ,
it return result but returned result is not complete, i cant identify where are the errors.
errors sported
1)returned result not complete

2) why i cant label the path G?

code as below;
master1 = Tk() P = str() G = str() Label(master1, text="Folder Location :",width=20).grid(row=0) def OpenFile2(): master1.filename = filedialog.askdirectory() G = os.path.normpath(master1.filename) P = os.path.isdir(G)#check print("\n", P,"\n", G) #check Button(master1, text ="OpenFile2", command = OpenFile2,width=10).grid(column = 3,row=0) Label(master1, text=G,width=60).grid(row=0,column=2) all_data = pd.DataFrame() for f in glob.glob(G + "\*.xlsx"): print("\n", P,"\n", G) #check df = pd.read_excel(f) all_data = all_data.append(df,ignore_index=True) print (all_data) #test print writer = ExcelWriter('Pandas-Example.xlsx') ll_data.to_excel(writer,'Sheet1',index=False) writer.save() master1.mainloop()