# eric7.QScintilla.Lexers.LexerPython

Module implementing a Python lexer with some additional methods.

### Global Attributes

None

### Classes

LexerPython | Subclass to implement some additional lexer dependant methods.

### Functions

createLexer | Function to instantiate a lexer object.

## LexerPython

Subclass to implement some additional lexer dependant methods.

### Derived from

SubstyledLexer, QsciLexerPython

### Class Attributes

None

### Class Methods

None

### Methods

LexerPython | PyQt5 PyQt6 Qsci Qt Qt3DAnimation Qt3DCore Qt3DExtras Qt3DInput Qt3DLogic Qt3DRender QtBluetooth QtChart QtCharts QtCore QtDataVisualization QtDBus QtDesigner QtGui QtHelp QtLocation QtMacExtras QtMultimedia QtMultimediaWidgets QtNetwork QtNetworkAuth QtNfc QtOpenGL QtOpenGLWidgets QtPdf QtPdfWidgets QtPositioning QtPrintSupport QtPurchasing QtQml QtQuick QtQuick3D QtQuickWidgets QtRemoteObjects QtSensors QtSerialPort QtSql QtSvg QtSvgWidgets QtTest QtTextToSpeech QtWebChannel QtWebEngine QtWebEngineCore QtWebEngineQuick QtWebEngineWidgets QtWebSockets QtWidgets QtWinExtras QtX11Extras QtXml QtXmlPatterns sip
autoCompletionWordSeparators | Public method to return the list of separators for autocompletion.
defaultKeywords | Public method to get the default keywords.
getIndentationDifference | Public method to determine the difference for the new indentation.
initProperties | Public slot to initialize the properties.
isCommentStyle | Public method to check, if a style is a comment style.
isStringStyle | Public method to check, if a style is a string style.
language | Public method to get the lexer language.
maximumKeywordSet | Public method to get the maximum keyword set.

### Static Methods

None

#### LexerPython (Constructor)

LexerPython(variant="", parent=None)

PyQt5 PyQt6 Qsci Qt Qt3DAnimation Qt3DCore Qt3DExtras Qt3DInput Qt3DLogic Qt3DRender QtBluetooth QtChart QtCharts QtCore QtDataVisualization QtDBus QtDesigner QtGui QtHelp QtLocation QtMacExtras QtMultimedia QtMultimediaWidgets QtNetwork QtNetworkAuth QtNfc QtOpenGL QtOpenGLWidgets QtPdf QtPdfWidgets QtPositioning QtPrintSupport QtPurchasing QtQml QtQuick QtQuick3D QtQuickWidgets QtRemoteObjects QtSensors QtSerialPort QtSql QtSvg QtSvgWidgets QtTest QtTextToSpeech QtWebChannel QtWebEngine QtWebEngineCore QtWebEngineQuick QtWebEngineWidgets QtWebSockets QtWidgets QtWinExtras QtX11Extras QtXml QtXmlPatterns sip

#### LexerPython.autoCompletionWordSeparators

autoCompletionWordSeparators()

Public method to return the list of separators for autocompletion.

Return:
  list of separators

Return Type:
  list of str

#### LexerPython.defaultKeywords

defaultKeywords(kwSet)

Public method to get the default keywords.

kwSet (int)
  number of the keyword set

Return:
  string giving the keywords or None

Return Type:
  str

#### LexerPython.getIndentationDifference

getIndentationDifference(line, editor)

Public method to determine the difference for the new indentation.

line (int)
  line to perform the calculation for
editor (Editor)
  QScintilla editor

Return:
  amount of difference in indentation

Return Type:
  int

#### LexerPython.initProperties

initProperties()

Public slot to initialize the properties.

#### LexerPython.isCommentStyle

isCommentStyle(style)

Public method to check, if a style is a comment style.

style (int)
  style to check

Return:
  flag indicating a comment style

Return Type:
  bool

#### LexerPython.isStringStyle

isStringStyle(style)

Public method to check, if a style is a string style.

style (int)
  style to check

Return:
  flag indicating a string style

Return Type:
  bool

#### LexerPython.language

language()

Public method to get the lexer language.

Return:
  lexer language

Return Type:
  str

#### LexerPython.maximumKeywordSet

maximumKeywordSet()

Public method to get the maximum keyword set.

Return:
  maximum keyword set

Return Type:
  int

Up

## createLexer

createLexer(variant, parent=None)

Function to instantiate a lexer object.

variant (str)
  name of the language variant
parent (QObject)
  parent widget of this lexer

Return:
  instantiated lexer object

Return Type:
  LexerPython

Up