There are some ways to execute python code from within vim. E.g.:
These approaches invoke a new python instance, transfer the code, execute the code, feed back the output and close the instance. Thus, the python workspace will always be empty at start of execution. No possibility to access previously calculated results. When I want to execute just an incremental subset (some lines) of my code, I would have to take care of all the prerequisites as well (cf.: working with MATLAB provides an interactive mode where the workspace is always persistent).
Is there a way to keep a python instance alive (keep the objects within the workspace) and feed incremental code portions from vim into the open python instance and execute them with respect to the retained workspace?
One could think of storing / retrieving the python workspace on each exit / entry of a new python instance, but this might not be the best way to keep the workspace alive.