Visual Studio Code - python console
<p>I'm using visual studio code with standard python extension, my issue is that when I run the code the python interpreter instantly closes right after and I only see the output which means that if I create some data structure I have to create it every single time. Is it possible to leave the console open after running the code and maybe running multiple files in the same python interpreter instance?</p>

<p>When you run a program, it runs until it ends. Then it closes. If you want it to stay live longer, you can make a program which does not stop until told so, e.g.</p>

<pre><code>while True:
    something = raw_input('Write something: ')
    print('You wrote: %s' % something)
    if something == 'bye':
        print 'bye.'
        break
</code></pre>

<p>This will run until user writes "bye".</p>

python vscode