QsciLexerPythonpretty limited when it comes to highlighting sets of keywords, as it gives you only two options. This restriction is imposed by the Python Lexer class from the core library Scintilla, so this cannot be done (unless you want to create a patch).
, , QsciLexerPython :
class CustomLexer(QsciLexerPython):
def keywords(self, keyset):
if keyset == QsciLexerPython.HighlightedIdentifier:
return b'WARNING'
return QsciLexerPython.keywords(self, keyset)
, .. :
pythonLexer = CustomLexer(self.text)
pythonLexer.setColor(
QColor('purple'), QsciLexerPython.HighlightedIdentifier)
...
(PS: , 0-255)