I"m getting this error as I try to make a ttk.Combobox using the values of a set that I select from a .db file.
for row in self.sql.execute("SELECT {0} FROM Songinfo".format(self.variable1.get())):
self.List2.append(row)
self.seen.add(row)
self.Option2 = ttk.Combobox(self, values=sorted(self.seen), textvariable=self.variable2)
self.Option2.grid(row=3, column=1)
self.seen
, when printed out returns something like:
{('Heavy Metal',), ('Soundtrack',), ('Pop/Rock',), ('Metal',),
('Alternative',), ('Alternative & Punk',), ('Rock',),
('Pop',), ('Classical Crossover',), (None,)}
this is a set of genres. I'm getting that error and I'm not sure why, it wasn't an issue till recently, any help is appreciated, thanks.
Remove the offending tuple from your set:
self.seen = {x for x in self.seen if x[0] is not None}
sorted(self.seen) is going to use < by default. You can supply a cmp or key function if you don't want that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With