The new version of the
StyledTextCtrl class in wxPython 3.0 uses an updated version of Scintilla, which has added a new feature to add annotations to the text being shown in the buffer. Annotations can be used to display read-only text underneath each line of editable text. The annotations can be used to display inline diagnostic messages to the user. In this recipe, we will use them to extend
PythonCodeEditor from the previous recipe to show
pep8 warning messages in the editor.
This recipe uses an external module called
pep8, which should be installed prior to trying this recipe. The
pep8 module can be installed using
pip or by downloading it from