Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/art1415926535/pyqt5-syntax-highlighting
If you need a code editor with syntax highlighting, but don't want something as heavyweight as QsciScintilla, you can use the QSyntaxHighlighter class to apply highlighting to a QPlainTextEdit widget.
https://github.com/art1415926535/pyqt5-syntax-highlighting
Last synced: about 1 month ago
JSON representation
If you need a code editor with syntax highlighting, but don't want something as heavyweight as QsciScintilla, you can use the QSyntaxHighlighter class to apply highlighting to a QPlainTextEdit widget.
- Host: GitHub
- URL: https://github.com/art1415926535/pyqt5-syntax-highlighting
- Owner: art1415926535
- Created: 2015-02-02T21:11:37.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-02-02T21:33:25.000Z (almost 10 years ago)
- Last Synced: 2023-03-11T06:42:16.005Z (almost 2 years ago)
- Language: Python
- Size: 129 KB
- Stars: 21
- Watchers: 2
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Python syntax highlighting
If you need a code editor with syntax highlighting, but don't want something as heavyweight as QsciScintilla, you can use the QSyntaxHighlighter class to apply highlighting to a QPlainTextEdit widget.
This example was based on existing work by Carson Farmer and Christophe Kibleur, and an example on the SciPres wiki. One aspect not addressed by this prior work is handling of Python's triple-quoted strings, which may span multiple lines; the QSyntaxHighlighter documentation includes an example for C++ comments, but those have different beginning and ending delimiters /* ... */, whereas Python's triple-quoted strings have the same delimiter at the beginning and end. These are handled by the match_multiline method--there may be an easier way to do this, but it seems to work pretty well, although it still has trouble with triple-quotes embedded inside another string.https://wiki.python.org/moin/PyQt/Python%20syntax%20highlighting
UPD: With Darcula theme from PyCharm