By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,276 Members | 1,951 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,276 IT Pros & Developers. It's quick & easy.

tkinter-listbox-different-text-colors-one-listbox

P: 1
hi,

tkinter-listbox-different-text-colors-one-listbox. I try to write each user with a different color to be able to differentiated. I always get the same error when I run the following code.

Expand|Select|Wrap|Line Numbers
  1.         for elt in result1:
  2.             userliste1.append(elt[1]+" "+elt[2])
  3.  
  4.         for elt in result2:
  5.             userliste2.append(elt[1]+" "+elt[2])
  6.  
  7.         result=[checkuser1 + ' '+ value for value in userliste1 if value not in userliste2]+[checkuser2+ ' '+ value for value in userliste2 if value not in userliste1]
  8.         if len(result)==0:
  9.             w.BenutzerVergleichUserStatusLabel(text=getMessage('9003'))
  10.             return 
  11.  
  12.         for row in result :
  13.             w.BenutzerVergleichProfileListbox.insert(tk.END, row[:8]+ ' : ' + row[8:])            
  14.             w.BenutzerVergleichProfileListbox.itemconfig(2, fg='red')
Jan 20 '20 #1
Share this Question
Share on Google+
1 Reply


Expert 100+
P: 626
I always get the same error when I run the following code
For those of us without chrystal balls, what is the error. Post the complete traceback. I find it easy to get examples from the web as bg and fg are standard config options like all widgets,
Jan 20 '20 #2

Post your reply

Sign in to post your reply or Sign up for a free account.