from PyQt5.Qt import * from PyQt5.Qsci import QsciScintilla from pathlib import Path if __name__ == '__main__': app = QApplication([]) view = QsciScintilla() view.setText(Path(__file__).read_text()) # Multiselection view.SendScintilla(view.SCI_SETMULTIPLESELECTION, True) view.SendScintilla(view.SCI_SETMULTIPASTE, 1) view.SendScintilla(view.SCI_SETADDITIONALSELECTIONTYPING, True) # Main/Additional selection coloring SC_ALPHA_NOALPHA = 256 view.SendScintilla(view.SCI_SETSELFORE, 0) view.SendScintilla(view.SCI_SETSELBACK, 1, QColor("#0000F0")) view.SendScintilla(view.SCI_SETSELALPHA, SC_ALPHA_NOALPHA) view.SendScintilla(view.SCI_SETADDITIONALSELBACK, QColor("#00F000")) view.SendScintilla(view.SCI_SETADDITIONALSELALPHA, SC_ALPHA_NOALPHA) view.resize(800, 600) view.show() app.exec_()