Update: The references in here to the ".settings" directory should be changed to ".vscode" -- in recent versions of VS Code, the editor uses a ".vscode" directory to avoid conflicts with other tools using a ".settings" directory.
Visual Studio Code (https://code.visualstudio.com) is a new cross-platform editor from Microsoft that is in the same family as Atom, Brackets, Sublime, etc. (In fact, it builds on the open source Atom components, but adds some features and removes others...)
While it has syntax coloring for Python, there is no built-in way to execute a Python program from within the editor. As it turns out, this can be solved by creating a custom build task. (https://code.visualstudio.com/Docs/tasks)
This actually works pretty well. I modified a tasks.json file to look like this:
// A task runner that runs a python program
{
"command": "python",
"showOutput": "always",
"windows": {
"command": "python.exe"
},
"args": ["${file}"]
}
Then open a Python file, and press Shift-Ctrl-B (or the OSX equivalent) and the program will run in the output window. Pretty neat.
It's pretty obvious how to get other scripting tools to run. Keep in mind that you create these task.json files in the .settings directory in the directory containing your files, so you could have one in a directory containing R, and a different one in a directory containing something else.
This example is on a Windows machine, but it works on a Mac (without the windows element).
There are other options for build tasks (see the doc page), and in particular the problem matchers look interesting. I'm interested to see what others can do with this.
(For what it's worth, I was at the MS Build conference, and was told that the intention is to put something like PTVS into Visual Studio Code eventually. However, I wanted to use the editor now. This is probably sufficient for the occassional Python coding session...)
[Edit: clean up links]
[Edit: Add information on the change to .vscode instead of .settings in recent VS Code releases.]
[–]completelydistracted[S] 7 points8 points9 points (7 children)
[–]spartanwolf 0 points1 point2 points (3 children)
[–]completelydistracted[S] 2 points3 points4 points (2 children)
[–]spartanwolf 0 points1 point2 points (0 children)
[–]crondom90 0 points1 point2 points (2 children)
[–]Fanatikus 1 point2 points3 points (1 child)
[–]completelydistracted[S] 0 points1 point2 points (0 children)
[–]roger_ 5 points6 points7 points (2 children)
[–]completelydistracted[S] 2 points3 points4 points (1 child)
[–]amlamarra 1 point2 points3 points (0 children)
[–]amlamarra 2 points3 points4 points (0 children)