Bonjour

Je réalise en ce moment un tableau de données (j'ai des capteurs qui remplissent ce tableau ) hors j'aimerais voir la dernière ligne quand celui ci la remplis.

Nom : page.png
Affichages : 2567
Taille : 6,8 Ko

J'ai déjà testé plusieurs façons de placer ceci en dernier , et malheureusement ceci ne fonctionne pas (on a python qui aime pas la ligne en question )

Merci d'avance pour votre aide.

Pour info , voici mon code, avec le tableau .
Code python : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
 
self.treeview.yview(END)
self.Scrollbar.yview(END)

Pour remplir le tableau pas de soucis :

Code python : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
class WindowsDisplayTable:
    def __init__(self):
 
        #Definition de variables 
 
 
 
 
        #Init 
        #   Create and configure a popup window.
        self.windows = Toplevel(self.parent)
        self.windows.grid_columnconfigure(0,weight=1,pad=400)
        self.windows.grid_rowconfigure(0,weight=1)
 
 
 
        title="WTable-"
        #if self.parent.version in locals():        
 
        self.windows.title(title)
 
        #Table  
        self.treeview = Treeview(self.windows,selectmode="extended")
        self.treeview.grid(sticky = (N,S,W,E))
        self.treeview.grid_rowconfigure(0, weight = 1) 
 
 
        #Button 
        self.buttonFrame = Frame(self.windows)
        self.buttonFrame.grid(sticky='swe')
        self.buttonFrame.grid_columnconfigure(0,weight=1)
        self.buttonFrame.grid_columnconfigure(1,weight=1)
        self.buttonFrame.grid_columnconfigure(2,weight=1)
        self.pompButton = ttk.Button(self.buttonFrame, text="---" , command=self.SignalButtonPomp).grid(column=0, row=0, sticky='we')
        self.stopADCButton = ttk.Button(self.buttonFrame, text="Stop", command=self.SignalButtonStopAdc).grid(column=1, row=0, sticky='we')
        self.saveReadout = ttk.Button(self.buttonFrame, text="Save" , command=self.SignalButtonSaveLog).grid(column=2, row=0, sticky='we')
 
        #Kill unit 
        self.windows.protocol('WM_DELETE_WINDOW', self.KILLsensorReader)
 
 
    #   Text box scroll bar.
        self.Scrollbar = Scrollbar(self.windows, command=self.treeview.yview)
        self.Scrollbar.grid(column=1, row=0, sticky='nse')
        #   Configure text box/scroll bar interaction.
        self.treeview.configure(yscrollcommand = self.Scrollbar.set)
        self.Scrollbar.configure(command = self.treeview.yview)
 
 
 
#mise a jour des titre aux colonnes 
# Pour info , j'ai : 
# NOM \n
# Moyenne (5 dernières valeurs ) \n
#Min max (5 dernières valeurs ) 
    def headingUpdate(self): 
 
        #Filter 
        #init variable 
        avr=[]
        minmax=[]
        i=0
 
        for x in self.treeview['columns']:
 
            avr.append("-")
            minmax.append(":-:")
            if self.tmpmemfilter[i].__len__()>=3:
                list=self.tmpmemfilter[i]
 
                avr[i]=Decimal(sum(list)/list.__len__() )
                avr[i]=avr[i].quantize(Decimal('.1'), rounding=ROUND_HALF_UP)
 
                minmax[i]=Decimal(max(list)-float(min(list)))
                minmax[i]=minmax[i].quantize(Decimal('.1'), rounding=ROUND_HALF_UP)
 
            i=i+1
 
 
 
        i=0
        for x in self.treeview['columns']:
            mytext= x + "\n "+ str(avr[i]) + "\n :" + str(minmax[i]) + ":"
            self.treeview.heading(x, text=mytext)
 
            i=i+1 
 
 
 
    def headingGenerate(self,list):
 
        self.treeview['columns'] = list
 
        self.treeview.heading("#0", text='id\n-\n-' )#anchor='w'
        self.treeview.column("#0", anchor="w", width=5 )
 
        self.headingUpdate()
 
 
        for x in self.treeview['columns']:
            self.treeview.column(x, anchor='center', width=70)
 
        self.treeview.grid_rowconfigure(0, weight = 1) 
        self.treeview.grid(sticky = (N,S,W,E) )


Ps: pour un ancien projet, j'utilisais une zone de texte, et j'utilisais ce code

Code python : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
#Configure 
        self.displayReadoutText = Text(self.displayReadout)
        self.displayReadoutText.grid(column=0, row=0, sticky='nswe')
        #   Text box scroll bar.
        self.adcScrollbar = Scrollbar(self.displayReadout, command=self.displayReadoutText.yview)
        self.adcScrollbar.grid(column=1, row=0, sticky='nse')
        #   Configure text box/scroll bar interaction.
        self.displayReadoutText.configure(yscrollcommand = self.adcScrollbar.set)
        self.adcScrollbar.configure(command = self.displayReadoutText.yview)
 
#Dernière ligne 
 
self.displayReadoutText.yview(END)