self.SetLexer(wxSTC_LEX_PYTHON)
self.SetKeyWords(0, " ".join(keyword.kwlist))
self.StyleClearAll()
# Global default styles for all languages
self.StyleSetSpec(wxSTC_STYLE_DEFAULT,     "fore:#000000,face:%(font)s,size:%(size)d" % faces)
self.StyleSetSpec(wxSTC_STYLE_LINENUMBER,  "back:#A5A5A5,face:%(font)s,size:%(size)d" % faces)
self.StyleSetSpec(wxSTC_STYLE_CONTROLCHAR, "face:%(font)s,size:%(size)d" % faces)
self.StyleSetSpec(wxSTC_STYLE_BRACELIGHT,  "fore:#FFFFFF,back:#0000FF,face:%(font)s,size:%(size)d,bold")
self.StyleSetSpec(wxSTC_STYLE_BRACEBAD,    "fore:#000000,back:#FF0000,face:%(font)s,size:%(size)d,bold")

# Python styles
# White space
self.StyleSetSpec(wxSTC_P_DEFAULT, "fore:#0A078D,face:%(font)s,size:%(size)d" % faces)
# Comment
self.StyleSetSpec(wxSTC_P_COMMENTLINE, "fore:#007F00,face:%(font)s,size:%(size)d" % faces)
# Number
self.StyleSetSpec(wxSTC_P_NUMBER, "fore:#007F7F,face:%(font)s,size:%(size)d" % faces)
# String
self.StyleSetSpec(wxSTC_P_STRING, "fore:#7F007F,face:%(font)s,size:%(size)d" % faces)
# Single quoted string
self.StyleSetSpec(wxSTC_P_CHARACTER, "fore:#7F007F,face:%(font)s,size:%(size)d" % faces)
# Keyword
self.StyleSetSpec(wxSTC_P_WORD, "fore:#00007F,face:%(font)s,bold,size:%(size)d" % faces)
# Triple quotes
self.StyleSetSpec(wxSTC_P_TRIPLE, "fore:#7F0000,face:%(font)s,size:%(size)d" % faces)
# Triple double quotes
self.StyleSetSpec(wxSTC_P_TRIPLEDOUBLE, "fore:#7F0000,face:%(font)s,size:%(size)d" % faces)
# Class name definition
self.StyleSetSpec(wxSTC_P_CLASSNAME, "fore:#0000FF,face:%(font)s,bold,underline,size:%(size)d" % faces)
# Function or method name definition
self.StyleSetSpec(wxSTC_P_DEFNAME, "fore:#007F7F,face:%(font)s,bold,size:%(size)d" % faces)
# Operators
self.StyleSetSpec(wxSTC_P_OPERATOR, "fore:#F68080,face:%(font)s,bold,size:%(size)d" % faces)
# Identifiers
self.StyleSetSpec(wxSTC_P_IDENTIFIER, "fore:#0A078D,face:%(font)s,size:%(size)d" % faces)
# Comment-blocks
self.StyleSetSpec(wxSTC_P_COMMENTBLOCK, "fore:#7F7F7F,face:%(font)s,size:%(size)d" % faces)
# End of line where string is not closed
self.StyleSetSpec(wxSTC_P_STRINGEOL, "fore:#000000,face:%(font)s,back:#E0C0E0,eol,size:%(size)d" % faces)
self.SetCaretForeground("BLUE")

self.colori={}
self.colori[wxSTC_P_DEFAULT]="#0A078D"
self.colori[wxSTC_P_COMMENTLINE]="#007F00"
self.colori[wxSTC_P_NUMBER]="#007F7F"
self.colori[wxSTC_P_STRING]="#7F007F"
self.colori[wxSTC_P_CHARACTER]="#7F007F"
self.colori[wxSTC_P_WORD]="#00007F bold"
self.colori[wxSTC_P_TRIPLE]="#7F0000"
self.colori[wxSTC_P_TRIPLEDOUBLE]="#7F0000"
self.colori[wxSTC_P_CLASSNAME]="#0000FF bold,underline"
self.colori[wxSTC_P_DEFNAME]="#007F7F bold"
self.colori[wxSTC_P_OPERATOR]="#F68080 bold"
self.colori[wxSTC_P_IDENTIFIER]="#0A078D"
self.colori[wxSTC_P_COMMENTBLOCK]="#7F7F7F"
self.colori[wxSTC_P_STRINGEOL]="#000000 back:#E0C0E0"