1

I have an existing application in C++ and Python that can take Python scripts as input to execute some tasks.

I want to let users create or edit these scripts directly in the application. I am looking for a library to perform some classical tasks needed for that, such as:

  • Management of copy / paste
  • Undo / Redo features
  • Maybe syntax highlighting (I already found Pygments for that purpose)
  • Auto-completion (I already have some code to generates lists of suggestions based on a keyword / token)
  • etc.

Does someone knows Python (or maybe C/C++) libraries or tools that can help me ?

Note: Our application uses our own GUI toolkit instead of existing (PyQt, Tk, etc). This toolkit directly writes shapes in OpenGL, and we already have a "widget" to write and edit multiline texts. We are looking for a tool to provide high level features mentionned above.

0
+50

I have been using QSyntaxHighlighter in my Python PyQt application. I created a class on top of the base textedit field and used QSyntaxHighlighter to create a full color syntax editor for MySQL source code. Works beautifully and also supports Undo/Redo by default (no extra effort). I haven't looked into auto-complete yet however. Just search for examples of QSyntaxHighlighter. I found an example and was able to modify it to my purposes with little effort.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.