2
Vote

"Execute Project in Python Interactive" resets execution engine every time

description

Whenever I execute a project in a interactive seesion, the session is resetted. This is independent on the session type (IPython, standard Python).

Is there any way to execute the project in an existing session? I have some smaller projects, where the execution time is shorter than the reset time of the python session, which makes this behaviour quite annoying.

PTVS 2.0.11016.00 in VS 2013 Prof. 12.0.21005.1 REL

OUTPUT:
Resetting execution engine
The Python REPL process has exited
Running \gar-sv-home01\henning.carstens\Visual Studio 2013\Projects\mode coupling\mode coupling\test.py
[IPKernelApp] To connect another client to this kernel, use:
[IPKernelApp] --existing c:\users\hennin~1.car\appdata\local\temp\tmpgfgsna.json

Welcome to pylab, a matplotlib-based Python environment [backend: module://IPython.zmq.pylab.backend_inline].
For more information, type 'help(pylab)'.
--> Here comes the output, after some time

comments

Zooba wrote Dec 2, 2013 at 3:43 PM

If all the code you want to execute is in a single file, you can use Select All->Send to Interactive (Ctrl+A, Ctrl+E+E). This works great if the code you're working on is the same code you're sending.

However, if you're editing modules that are used by your main script, you really need to reset Python each time. It is possible (using the reload function) to avoid having to reset, but you'll run the risk of having invalid results or mismatched objects in memory.

Right now there's no way to avoid resetting with this command, though we are thinking about ways to make your particular task easier in later versions (probably not our next one or two releases, but we are considering your use case).

henningcarstens wrote Dec 3, 2013 at 7:40 AM

Thanks for the answer. In Spyder, there is something called "User Module Deleter (UMD)" that does the job, so maybe using their library might me an option.

This is quite handy for smaller code (that is located in multiple files, though), where I heavily use "trial and error" for debugging/coding.