F
flamz3d
Hello,
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
code.
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?
cheers.
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
code.
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?
cheers.