Python Forum
modify the color a string of characters in python 3.6
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
modify the color a string of characters in python 3.6
#10
I try the procedure of the previous link cited, but I have a problem :

this is the end of the code of the update fonction of the Text widget tkinter:

T_cev_loc35R.insert(END,contenu_table_cev_loc35R)
        if variable_case_correction_loc35R.get ()==0 :
			
            T_cev_loc35R.tag_add("start", "3.5", "3.53")
            T_cev_loc35R.tag_config("start", foreground="black")
        else :
			
            T_cev_loc35R.tag_add("start", "3.9", "3.49")
            T_cev_loc35R.tag_config("start",  foreground="green")
   
curseur3_cev_loc35R.close()
the coloring of the character string is relative to the indexing of the line
when I introduce another data into my database
the line 3 is changed and is not colored at green because of the condition about "variable_case_correction_loc35R"
Reply


Messages In This Thread
RE: modify the color a string of characters in python 3.6 - by atlass218 - Feb-26-2019, 08:51 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Turtle Star Fill Color Yellow-White Interchanging Color Effect codelab 9 1,043 Oct-25-2023, 09:09 AM
Last Post: codelab
  doing string split with 2 or more split characters Skaperen 22 2,567 Aug-13-2023, 01:57 AM
Last Post: Skaperen
  How do I check if the first X characters of a string are numbers? FirstBornAlbratross 6 1,558 Apr-12-2023, 10:39 AM
Last Post: jefsummers
Question Help me modify this .txt into .csv with Python mgzz 1 752 Dec-14-2022, 01:38 PM
Last Post: Axel_Erfurt
  How to modify python script to append data on file using sql server 2019? ahmedbarbary 1 1,233 Aug-03-2022, 06:03 AM
Last Post: Pedroski55
Photo Visual studio code unable to color syntax on python interpreter tomtom 4 6,934 Mar-02-2022, 01:23 AM
Last Post: tomtom
Question [SOLVED] Delete specific characters from string lines EnfantNicolas 4 2,239 Oct-21-2021, 11:28 AM
Last Post: EnfantNicolas
  I am writing a car rental program on python. In this function I am trying to modify aboo 2 2,759 Aug-05-2021, 06:00 PM
Last Post: deanhystad
  Extract continuous numeric characters from a string in Python Robotguy 2 2,657 Jan-16-2021, 12:44 AM
Last Post: snippsat
  Python win32api keybd_event: How do I input a string of characters? JaneTan 3 3,844 Oct-19-2020, 04:16 AM
Last Post: deanhystad

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020