File indexing completed on 2024-06-16 04:17:41

0001 """
0002 SPDX-FileCopyrightText: 2017 Eliakin Costa <eliakim170@gmail.com>
0003 
0004 SPDX-License-Identifier: GPL-2.0-or-later
0005 """
0006 # editor.py
0007 
0008 from PyQt5.QtCore import *
0009 from PyQt5.QtGui import *
0010 from PyQt5.QtWidgets import *
0011 
0012 import syntax
0013 
0014 app = QApplication([])
0015 editor = QPlainTextEdit()
0016 f = QFont("monospace", 10, QFont.Normal)
0017 f.setFixedPitch(True)
0018 editor.document().setDefaultFont(f)
0019 highlight = syntax.PythonHighlighter(editor.document())
0020 
0021 
0022 editor.show()
0023 
0024 # Load syntax.py into the editor for demo purposes
0025 
0026 # infile = open('syntax.py', 'r')
0027 # editor.setPlainText(infile.read())
0028 
0029 app.exec_()