I stumbled across the following code:
for i,a in enumerate(attributes): labels.append(Label(root, text = a, justify = LEFT).grid(sticky = W)) e = Entry
Enumerate basically gives you an index to work with in the for loop. So:
for i,a in enumerate([4, 5, 6, 7]): print i, ": ", a
Would print:
0: 4 1: 5 2: 6 3: 7