Hi, I am new to python but learned somewhat about lists, tuples, dictionaries, db and gui (just introductory stuffs), and am trying to write a program that will alllow users to input some key words to search in a report. if key words are present in the report then the program should highlight them either yellow or red or any color highlight over the key words.

how can i code it?


here's a small example illustrating the find function:

s = """This is an example
string searching method."""

word = "searching"
print s.find( word )
# -> 26
# and some documentation for the function:

#Help on built-in function find:

#    S.find(sub [,start [,end]]) -> int
#    Return the lowest index in S where substring sub is found,
#    such that sub is contained within s[start:end].  Optional
#    arguments start and end are interpreted as in slice notation.
#    Return -1 on failure.

you should check vegaseat's example on highlighting words in text, I think it is in here:


hope this gives you some ideas :)