Visual Studio Code was recently released and I liked the look of it and the features it offered, so I figured I would give it a go.
I downloaded the application from the downloads page, fired it up, messed around a bit with some of the features ... and 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 Visual Studio Code, but I can't seem to find out how to run my Python code, a real killer because that's what I program primarily in.
Is there is a way to execute Python code in Visual Studio Code?
There is a much easier way to run Python, and it doesn't need any configuration:
If you want to add the Python path, you could go to File → Preference → Settings, and add the Python path like below:
"code-runner.executorMap":
{
"python": "\"C:\\Program Files\\Python35\\python.exe\" -u"
}
In case you have installed the Python extension and manually set your interpreter already, you could configure your settings.json file as follows:
{
"python.pythonPath": "C:\\\\python36\\\\python36.exe",
"code-runner.executorMap":
{
"python": "$pythonPath -u $fullFileName"
}
}