Python Highlighter

QSyntaxHighlighter for Python syntax.

class bci_framework.framework.editor.highlighters.python_syntax.PythonHighlighter(document)[source]

Syntax highlighter for the Python language.

classmethod get_format(color, style='', fontsize=None)[source]

Return a QTextCharFormat with the given attributes.

highlightBlock(text)[source]

Apply syntax highlighting to the given block of text.

match_multiline(text, delimiter, in_state, style)[source]

Do highlighting of multi-line strings. delimiter should be a QRegularExpression for triple-single-quotes or triple-double-quotes, and in_state should be a unique integer to represent the corresponding state changes when inside those strings. Returns True if we’re still inside a multi-line string when this function is finished.

property styles

The styles depend on the theme.