Firstly I developed preliminary versions of syntax highlighting and tab complete features. This version use XML file processing to provide a basic set of keywords and built-in functions to these features. To activate tab complete, press Tab button after some letter. You can see some screenshots of these features below (click mouse right-button and enlarge it):
A simple syntax highlighting
More syntax highlighting and tab complete
Next, the preliminary version of the backend developed during LaKademy was build to support python script mode. But it would be more interesting to support python interactive mode in Cantor console. So, to do it, I implemented preprocessing in python command before send it to python interpreter, adding some commands to simulate python interactive mode.
This solution use PyRun_SimpleString from python/C API to process python commands in python script mode. There is other functions from python/C API to process python commands in interactive mode, for example, PyRun_InteractiveOne, but this function requires the python commands in a file to process and the output of commands is a bit of hard to get. So, for now, PyRun_SimpleString + preprocessing commands is working very well.
You can see in screenshots below and above that variable values and operation values are show in Cantor console without use of print command. It is a one of characteristic of python interactive mode:
More examples of syntax highlighting and python interactive mode
Now I am developing a feature to list all functions and keywords from a specific python module imported during the program execution. I am using dir command to do it. This feature will provide these keywords to use in syntax highlighting and tab complete in a dynamic way. Then, python backend will support any python module, and not scipy, numpy, and matplotlib only.
Python backend is available in python-backend branch in Cantor repository. You can test it, but remember this code is not stable and finalized for now.