pyqode.python.code_edit¶
This package contains the python code editor widget
- class pyqode.python.widgets.code_edit.PyCodeEdit(parent=None)[source]¶
Bases: pyqode.core.api.code_edit.CodeEdit
Extends CodeEdit with a hardcoded set of modes and panels specifics to a python code editor widget.
It also implements utility methods to switch from a white style to a dark style and inversely.
Note
This code editor widget use PEP 0263 to detect file encoding. If the opened file does not respects the PEP 0263, locale.getpreferredencoding() is used as the default encoding.
- setPlainText(txt, mimetype='text/x-python', encoding='utf-8')[source]¶
Extends QCodeEdit.setPlainText to allow user to setPlainText without mimetype (since the python syntax highlighter does not use it).
- DARK_STYLE = 0¶
- LIGHT_STYLE = 1¶
- mimetypes = ['text/x-python']¶