Changing colour of item in Tkinter listbox
<p>In reference to <a href="https://stackoverflow.com/questions/5348454/is-it-possible-to-colour-a-specific-item-in-a-listbox-widget">Is it possible to colour a specific item in a Listbox widget?</a> Is it possible to change the <strong>bg colour</strong> based on the data being held in the list.</p>

<p>For example:</p>

<p>In the list <em>names</em> there are several values, some positive, others negative. I want to change their background colour based on if they are positive or negative.</p>

<pre><code>if names &gt; 0 :
    diffbox.itemconfig(bg='red')
if names &lt; 0 :
    diffbox.itemconfig(bg='green')

diffbox.insert(END, names)
</code></pre>