title: Change color of certain words in Tkinter Text widget based on position in list
body: <p>I have a tkinter text box, and I want to change the colour of specific words depending in their position in a list. Basically I have the list <code>foo = [1,4,5,8,9]</code>, and I want to change the colour of the words which correspond to the numbers in the list. So words in positions 1, 4, 5, 8, and 9 should have their colour changed. I have had a look at different answers, but they operate on the basis of keywords--not the position of a given word.</p>