AutoComplete in C++ Editor for Python

flamz3d at flamz3d at
Sun May 3 15:08:02 CEST 2009

I am embedding python support in my C++ application and was looking at
adding "Intellisense" or "AutoComplete" support.

I found a way to do it using the "dir" function, but this creates a
problem. Here's why. Let's say I have the following code in my editor:

import sys
x = sys

Now, I would like to get all attributes of the object called 'x'. I
can "instrument" the code and add "print dir(x)" at the end,
temporarily redirect the python output to a string and execute the

But this is not safe: I do NOT want to execute the code while the user
is typing!

Is there a way to "compile" the python code and get access to the
symbol table from that compiled block?

Did anybody ever implement AutoComplete in a editor for Python?


More information about the Python-list mailing list