suppose we have a lot of buttons with specified texts & locations... for example our buttons are {'main','report', 'memory', 'bills',...} now we have an array that determine which button should be visible for example z1=['report', 'bills'] the contents of this array can be the other buttons in your oponions, how can i write the code? should i compare the text of every button with "z1" array, before defining every button this is not reasonable,because the numbers of buttons are alot please helppppppp
this is mu code

this is mu code
[ z1=['report','bills','setting'] self.button = Button(self.master,text="memory", command=self.ouvrir) self.button.grid(row=1, column=1) self.button2 = Button(self.master,text="report", command=self.tabluh) self.button2.grid(row=1, column=2) self.button3 = Button(self.master,text="setting", command=self.new_window) self.button3.grid(row=1, column=3) self.button4 = Button(self.master,text="calibration", command=self.cal) self.button4.grid(row=1, column=4) self.button5 = Button(self.master,text="empty weight", command=self.weighing) self.button5.grid(row=1, column=5) self.button6 = Button(self.master,text="bills", command=self.history) self.button6.grid(row=1, column=6) self.button7 = Button(self.master,text="full weight", command=self.full) self.button7.grid(row=1, column=7)][/python]
Moderator Larz60+: Added python tags. please do so in the future. indentation seems incorrect