I'm absolutely pulling my hair out over this. The if/elif statement in this function throws a syntax error on the elif line. To me there are no obvious syntax problems.
"elif n == cs_index:"
^
SyntaxError: invalid syntax
I tried switching it to a bear "else:" just to see if that would stupidly word and it didn't. I'm sure there's something I don't see.
def higherhighlight(cs_index):
text.tag_remove("the hello","1.0", END)
idex = "1.0"
for n in range(cs_index):
if n < cs_index:
idex = text.search("Hello", idex, nocase=1, stopindex=END)
lastidex = idex+"+"+str(len("hello"))+"c"
idex = lastidex
elif n == cs_index:
idex = text.search("Hello", idex, nocase=1, stopindex=END)
print idex
lastidex = idex+"+"+str(len("hello"))+"c"
print lastidex
text.tag_remove("hellos", idex, lastidex)
text.tag_add("the hello", idex, lastidex)
text.tag_config("the hello", background="dark green")