|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stop making mediocre tutorials.The best tutorials are video! Camtasia Studio makes it easy to create engaging, buzz-building screen videos at any size, in any popular format. Download the free trial!
|
|
#1
|
||||
|
||||
|
Highlight words
Hi, I would like to know how can I Highlight words with specific colors in my Tkinter code? I guess I can use the tokenize module, Im making something like the below code. is that correct? or what can I do to Highlight words?
Thanks a lot. Code:
import tokenize
import keyword
KEYWORD="Keyword"
TOKEN_START={tokenize.Word:"<font color=BLUE>",
tokenize.Word1:"<font color=RED>",
tokenizeWord2:"<font color=GREEN>",
Word3:"<font color=ORANGE>",
TOKEN_END={tokenize.Word::"</font>",
tokenize.Word1:"</font>",
tokenize.Word2:"</font>",
Word3:"</font>",
}
Last edited by Gerardoj : December 1st, 2003 at 01:10 PM. |
|
#2
|
||||
|
||||
|
Jurgen Hermann wrote a python colorizer using the tokenize module. His code outputs HTML file, but you could modify it to use tkinter.
http://twistedmatrix.com/users/jh.t...inMoinColorizer
__________________
Up the Irons What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home. "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest Down with Sharon Osbourne Puzzle of the Month solved by sizeablegrin, etienne141 and L7Sqr, superior C/C++ programmers of the month |
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Python Programming > Highlight words |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|