Re: [Tutor] Shorten this code
Mic wrote: > class SeatButton(tk.Button): > def __init__(self, master, index): > text = str(index+1) > super(SeatButton, self).__init__(master, > text=text, bg=FREE, > command=self.clicked) >
Re: [Tutor] Shorten this code
God morning! That's right, because your SeatButton init doesn't check to see if a file exists for it, it always colors it green. You need to read the directory and see whether a file for that seat exists. If it does color it red. (Hint: look at os.path.exists() ) Alright, I think I now manage