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>

<p>I'm the author of the extension.
There are two options:</p>

<ol>
<li><p>Use the integrated terminal window (I guess you already knew this)<br>
Launch the terminal window and type in <code>python</code>.<br>
Every statement executed in the REPL is within the same session. </p></li>
<li><p>Next version will add support for Jupyter.<br>
Please have a look here for some samples of what is yet to come:  </p>

<ul>
<li><a href="https://github.com/DonJayamanne/pythonVSCode/issues/303" rel="nofollow">#303</a>  </li>
<li>Screen <a href="https://github.com/DonJayamanne/pythonVSCodeDocs/blob/master/images/jupyter/examples.gif" rel="nofollow">samples</a> and <a href="https://github.com/DonJayamanne/pythonVSCodeDocs/tree/master/images/jupyter" rel="nofollow">more</a></li>
</ul></li>
</ol>

python ipython vscode