I think that the problem I encountered was not well understood. for that I explain again to have a good idea about the problem : there are two text files that I want to integrate into a widgte (TEXT)
the content of two files (loc2.txt,loc2.txt)
loc1.txt:
loc2.txt:
the first column of two txt files(loc1.txt and loc2.txt)is the same (It describes date)
I want to display the contents of these two files in a widget (TEXT) in this way:
* the first column displayed in the widget (TEXT) would be the column of the date (which is already the first common column for the two text files loc1.txt, and loc2.txt)
* the second column displayed in the widget TEXT would be the second column of the text file (loc1.txt)
* the third column displayed in the widget TEXT would be the second column of the text file (loc2.txt)
here is the image of the desired concept:
currently, I can only display the contents of a single text file in the widget by this code :
the content of two files (loc2.txt,loc2.txt)
loc1.txt:
Quote:21/06/18 -0.7
22/06/18 -0.5
06/07/18 -0.7
13/07/18 -0.6
20/07/18 -0.3
27/07/18 -0.5
10/08/18 -1.2
17/08/18 -0.5
24/08/18 -0.3
21/09/18 -0.2
28/09/18 -0.4
17/10/18 -0.1
loc2.txt:
Quote:21/06/18 -0.7
22/06/18 -0.5
06/07/18 -0.8
13/07/18 -0.7
20/07/18 -0.3
27/07/18 -0.7
10/08/18 -1.0
17/08/18 -0.5
24/08/18 -0.3
21/09/18 -0.2
28/09/18 -0.5
17/10/18 -0.3
the first column of two txt files(loc1.txt and loc2.txt)is the same (It describes date)
I want to display the contents of these two files in a widget (TEXT) in this way:
* the first column displayed in the widget (TEXT) would be the column of the date (which is already the first common column for the two text files loc1.txt, and loc2.txt)
* the second column displayed in the widget TEXT would be the second column of the text file (loc1.txt)
* the third column displayed in the widget TEXT would be the second column of the text file (loc2.txt)
here is the image of the desired concept:
currently, I can only display the contents of a single text file in the widget by this code :
from tkinter import * import tkinter.ttk as ttk from tkinter.ttk import Notebook container=Tk() container.geometry('450x350') generalites=Frame(container,bg='powder blue') generalites.pack(side=BOTTOM) s_generalites= Scrollbar(generalites) T_generalites= Text(generalites,bg='powder blue',width=350,height=350) s_generalites.pack(side=RIGHT, fill=Y) T_generalites.pack(side=LEFT, fill=Y) s_generalites.config(command=T_generalites.yview) T_generalites.config(yscrollcommand=s_generalites.set) filename =('loc1.txt') fichier = open(filename, "r") content_generalites= fichier.read() fichier.close() T_generalites.insert(END, content_generalites) container.mainloop()I hope that I have successfully explained the problem