In article <8dca57e8-8258-4020-9788-987af332b...@googlegroups.com>, eneskri...@gmail.com wrote:
I don't use tkinter, but here's what I can figure out from looking at your code and http://effbot.org/tkinterbook/variable.htm > var = [] > while i < self.something: > var.append(IntVar()) > i += 2 At this point, var is a list of IntVar instances. > for r in var: > helper = var[r].get() > self.something_else[helper] += 1 You are iterating over the element of var, so each time through the loop, r is an IntVar instance. But, you're using r to index a list in > helper = var[r].get() That's what > TypeError: list indices must be integers, not IntVar means. I suspect what you want is to retrieve the integer value from r, and use that as the index: > helper = var[r.get()] but without knowing more about your code, that's just a guess. At a deeper level, however, there's something that fundamentally doesn't make sense here. You are iterating over the values in var, then using each value as an index again. That's not *wrong*, but it seems unlikely to be what you want. -- https://mail.python.org/mailman/listinfo/python-list