View Single Post
Old 01-12-2019, 05:19 AM   #420
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,739
Karma: 24031403
Join Date: Dec 2010
Device: Kindle PW2
I recently stumbled upon QScintilla, which comes with very easy to use Python bindings.

For example, the following proof-of-concept code that I found on the Internet is enough to display an editor with document-based autocompletion:

Code:
"""Base code originally from: http://kib2.free.fr/tutos/PyQt4/QScintilla2.html"""
import sys
import os
from PyQt5 import QtWidgets, Qsci

app = QtWidgets.QApplication(sys.argv)
editor = Qsci.QsciScintilla()
lexer = Qsci.QsciLexerPython(editor)
editor.setLexer(lexer)
editor.setAutoCompletionThreshold(1)
editor.setAutoCompletionSource(Qsci.QsciScintilla.AcsDocument)

editor.show()
editor.setText(open(sys.argv[0]).read())
sys.exit(app.exec_())
QScintilla/Scintilla also supports code folding, code highlighting and recordable macros. IMHO, it'd make for a useful addition to the Python interpreter bundled with Sigil. (The Windows version of the library would only add about 7.5MB.)

@KevinH @DiapDealer what do you guys think about this idea?

Last edited by Doitsu; 01-12-2019 at 05:21 AM.
Doitsu is offline   Reply With Quote