I have installed Visual Studio Code in my Ubuntu. But I can't use Python.
Some information:
I didn't install any python version. I am currently using it on terminal or Python idle 2.7
Can anyone help me?
I have installed Visual Studio Code in my Ubuntu. But I can't use Python.
Some information:
I didn't install any python version. I am currently using it on terminal or Python idle 2.7
Can anyone help me?
VS Code does not support Python out of the box like it does for example Node.js or C#. It offers syntax highlighting, indentation and very basic code-hinting, but that's it. In particular you have to make do without debugging.
On the other hand it is very flexible and quite easily extended, since it allows the definition of custom 'tasks'. In particular you may define a
Run Build
task, which is by default executed with Ctrl+Shift+B. (To see a list of all commands available press Ctrl+Shift+P.)Open a Python file and press Ctrl+Shift+B. It will open a message saying "No task runner configured". This is on Windows but looks exactly the same on Ubuntu.
Press "Configure Task Runner". It will open/create the file
.vscode/tasks.json
under the project folder.Note: In versions<
0.8.0
the folder is named.settings
.Replace the instructions with
and save the file.
Go back to your Python file and press Ctrl+Shift+B again. It should run the code with
python
and show the output in an output pane. Note however, that it will not work if you're reading fromstdin
somewhere, as Code only displays the output, but does not allow for input.See also:
As said in the beginning, VSCode's strengths really are Node, TypeScript, C#, as it offers IntelliSense and debugging capabilities.
Personally I am very fond of JetBrains PyCharm Community Edition. It's a little memory intensive, but brings all the goodies like autocompletion, debugging, support for virtual environments, etc. to the table.