• 0

where and how to run Python code from within VSCode?



dear community here at Neowin ... 

I just installed VSCode (https://code.visualstudio.com/) on the notebook.

I like the look of it and like its tools and features. (note i runned ATOM for some months now and PyCharm for allmost one year)
I am impressed by the set of features VSCode offered, so I figured I would give it a go.

I just downloaded installed the application and fired it up, messed around a bit with some of the cool features

but wait: after playing around - then realized I had no idea how to actually execute any of my Python code!
I really like the look and feel/usability/features of VSCode, but I can't seem to find out how and where to run my Python code,

Does anyone know if there is a way to execute Python code in VSCode?

Note: ATOM is not eays too - but with the right setup youre able to go ahead...


btw: i love the features in VSCode..

( https://code.visualstudio.com/) 


Git commands built-in:


Working with Git and other SCM providers has never been easier. Review diffs, stage files, and make commits right from the editor. Push and pull from any hosted SCM service.

Extensible and customizable:


Want even more features? Install extensions to add new languages, themes, debuggers, and to connect to additional services. Extensions run in separate processes, ensuring they won't slow down your editor. Learn more about extensions.


Edited by tarifa
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0


after a extensive search i found out that there are some few options to go ahead.



I heard about the option: that it is possible to compile Visual Studio Code and install it through terminal as explained ....  Well I wonder, how is it possible to install/add extensions to VSCode through Terminal? / command line. 


I mused some times and guess that it can be dones like so: 

can we get the command line help with the following commands: (cf this little overview)


can we get the command line help with the following commands: 

code -h
(A man pages doesn't exist unfortunatley.)

Extensions Management:
  --extensions-dir <dir>                                         Set the root path for extensions.
  --list-extensions                                              List the installed extensions.
  --show-versions                                                Show versions of installed extensions, when
                                                                 using --list-extension.
  --install-extension (<extension-id> | <extension-vsix-path>)   Installs an extension.
  --uninstall-extension (<extension-id> | <extension-vsix-path>) Uninstalls an extension.
  --enable-proposed-api <extension-id>                           Enables proposed API features for an extension.

Hence all we need is the extension-id or extension-vsix-path and then

code --install-extension (<extension-id> | <extension-vsix-path>)
E.g. the ms-python package can be installed by

code --install-extension ms-python.python


What do you say... 

BTW - is this solution better that sticking to ATOM - which still is on my Machine too ?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    • No registered users viewing this page.