Visual studio code interactive python console : <p>I'm using visual studio code with DonJayamanne python extension. It's working fine but I want to have an interactive session just like the one in Matlab, where after code execution every definition and computational result remains and accessible in the console. </p>

<p>For example after running this code: </p>

<pre><code>a = 1
</code></pre>

<p>the python session is terminated and I cannot type in the console something like:</p>

<pre><code>b = a + 1
print(b)
</code></pre>

<p>I'm aware that the python session can stay alive with a "-i" flag. But this simply doesn't work. </p>

<p>Also every time I run a code file, a new python process is spawned. Is there a way to run consecutive runs in just one console? Again like Matlab?</p>

<p>This sounds really essential and trivial to me. Am I missing something big here that I can't find a solution for this?</p>
