Python模块
livelex-qt的Python项目详细描述
将livelex与Qt的QTextDocument一起使用的小型Python库
这个模块依赖于livelex。在
主页:https://github.com/wbsoft/livelex-qt 下载:https://pypi.org/project/livelex-qt
示例:
fromPyQt5.QtWidgetsimportQApplicationfromPyQt5.QtGuiimportQTextDocumentapp=QApplication([])importlivelexqtimportlivelex.lang.xmllexicon=livelex.lang.xml.Xml.rootdoc=QTextDocument()livelexqt.SyntaxHighlighter.instance(doc,lexicon)# Now the text in the document is automatically highlighted using the# specified root lexicon.
- 项目
标签: