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.
Does anyone know if there is a way to execute Python code in Visual Studio Code?
Here is how to Configure Task Runner in Visual Studio Code to run a py file.
In your console press Ctrl+Shift+P (Windows) or Cmd+Shift+P (Apple) and this brings up a search box where you search for "Configure Task Runner"
EDIT: If this is the first time you open the "Task: Configure Task Runner", you need to select "other" at the bottom of the next selection list.
This will bring up the properties which you can then change to suit your preference. In this case you want to change the following properties;
"tsc"
(TypeScript) to "Python"
"silent"
to "Always"
args
(Arguments) from ["Helloworld.ts"]
to ["${file}"]
(filename)problemMatcher
You can now open your py file and run it nicely with the shortcut Ctrl+Shift+B (Windows) or Cmd+Shift+B (Apple)
Enjoy!
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments