AutoComplete in Python Interpreter Console works, but not in editor window

962 views
Skip to first unread message

Alexander S.

unread,
May 3, 2011, 12:26:00 PM5/3/11
to PyScripter
Hello,

for instance if i make a new module test.py and write
"from win32com.shell import shellcon"
and then
"shellcon."
and press Ctrl+Space
i do not get any suggestions.

however, if i write those lines into the Python Interpreter Console
window, then I get all suggestions.
">>> from win32com.shell import shellcon"
">>> shellcon."

why is that so?


Regards

Chris Zeh

unread,
May 12, 2011, 11:46:55 AM5/12/11
to PyScripter
I have the same issue. Is this an expected behavior?

PyScripter

unread,
May 27, 2011, 1:50:31 PM5/27/11
to pyscr...@googlegroups.com

Chris Zeh

unread,
Jul 26, 2011, 6:52:06 PM7/26/11
to pyscr...@googlegroups.com
I'm curious if there is any way to force the AutoComplete in the Editor window to explore the objects that have been created in the Interpreter window?
 
For example say we are manipulating data in the Interpreter window:
>>> import numpy
>>> data = numpy.zeros((10,10))
 
Now we want to create a script in the Editor window to modify this data. It would be nice if the Editor window's code complete would Auto Complete something like the following:
data.min()
 
This is an oversimplified example, but when it comes to using things like the interactive environment of matplotlib (pylab) it is critical to have code completion in the editor of objects in the Interpreter namespace.
 
I hope this is clear, let me know what you think.
 
 
 

PyScripter

unread,
Jul 27, 2011, 4:30:20 PM7/27/11
to pyscr...@googlegroups.com
The fact that you created an object in the interpreter does not and should not make it available in a script (which is meant to run independently).  You can inspect live objects in the Variables Window though.

Chris Zeh

unread,
Jul 28, 2011, 2:24:42 PM7/28/11
to PyScripter
Our previous editor PythonWin as well as IDLE both work in this way.
I'm curious if it would be difficult to add this functionality to
pyScripter as an option?

We use Python/matplotlib in a workflow attempting to replicate that
which is found in MATLAB. Typically this means running scripts
interactivily, building small .py files we run to collect and post-
process data from equipment which is active in the interactive
console, as well as to dynamically generate and modify plots/graphs.

This workflow is different than a typical software develper who wants
a clean environement between runs, our coding is more fluid and
dynamic.

(We disable the "Reinitialize before run" option)

In PyScripter presently you can create an object in the interactive
window, let's say:
>>> data = 100

Then run a script:
'---------
Test.py
'----------
print data

which will output:
>>>
100

The fact that this data object created in the interactive namespace is
available to be accessed by the editor makes me think the editor
should allow this type of code-completion, at very least as an option.

Your thoughts?

PyScripter

unread,
Aug 5, 2011, 3:33:01 AM8/5/11
to pyscr...@googlegroups.com
It is a valid use and could be implemented, by mimicking in the editor the code completion that happens in the interpreter.  If you feel strongly about this please submit an issue in the Issue tracker at pyscripter.googlecode.com.

Chris Zeh

unread,
Aug 5, 2011, 10:49:07 AM8/5/11
to PyScripter
Great, thanks! I've added the enhancement to the issue tracker.

--Chris
Reply all
Reply to author
Forward
0 new messages