How to execute Python code from within Visual Studio Code

RPiAwesomeness

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?

python_starter

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" enter image description here

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;

  1. Change the Command property from "tsc" (TypeScript) to "Python"
  2. Change showOutput from "silent" to "Always"
  3. Change args (Arguments) from ["Helloworld.ts"] to ["${file}"] (filename)
  4. Delete the last property problemMatcher
  5. Save the changes made

enter image description here

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.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Visual studio Code with python

From Dev

how to export code from visual studio as a document

From Java

How do I duplicate a line or selection within Visual Studio Code?

From Dev

How to execute code in a new tmux session - from within current session?

From Dev

How to execute code in a new tmux session - from within current session?

From Dev

How to run PHP code from Visual Studio Code (VSCode)?

From Dev

How can I debug Python 3 code in Visual Studio Code?

From Dev

Execute code only while debugging with Visual Studio

From Java

Running npm command within Visual Studio Code

From Dev

Execute Scala code from within Emacs

From Dev

Code background from Visual Studio

From Dev

Visual Studio Code indentation for Python

From Dev

How to format code in Visual Studio Code on Windows

From Dev

How to change code formatting in Visual Studio Code

From Dev

how to setup visual studio code

From Dev

Debug Python from Visual Studio Code - Importing Numpy

From Dev

Start automatically python webserver from visual studio code

From Java

How to open Visual Studio Code from the command line on OSX?

From Dev

How to google from the context menu of the Visual Studio 2015 code editor

From Java

How to install Visual Studio Code extensions from Command line

From Dev

How to open browser from Visual Studio Code API

From Dev

How to open Visual Studio Code (0.5.0 - 0.7.0) from Unity on OSX

From Dev

How to get the hex color code from a color dialog in visual studio?

From Dev

How to open project from source code in Visual Studio 2005

From Dev

How to COMPLETELY uninstall Visual Studio Code from Windows 10?

From Dev

How to prevent Visual Studio Code from opening files in the current tab?

From Dev

How to execute compiled python code

From Dev

How to execute compiled python code

From Dev

Running python script in Visual Studio Code; how to get `input ()` to work?

Related Related

  1. 1

    Visual studio Code with python

  2. 2

    how to export code from visual studio as a document

  3. 3

    How do I duplicate a line or selection within Visual Studio Code?

  4. 4

    How to execute code in a new tmux session - from within current session?

  5. 5

    How to execute code in a new tmux session - from within current session?

  6. 6

    How to run PHP code from Visual Studio Code (VSCode)?

  7. 7

    How can I debug Python 3 code in Visual Studio Code?

  8. 8

    Execute code only while debugging with Visual Studio

  9. 9

    Running npm command within Visual Studio Code

  10. 10

    Execute Scala code from within Emacs

  11. 11

    Code background from Visual Studio

  12. 12

    Visual Studio Code indentation for Python

  13. 13

    How to format code in Visual Studio Code on Windows

  14. 14

    How to change code formatting in Visual Studio Code

  15. 15

    how to setup visual studio code

  16. 16

    Debug Python from Visual Studio Code - Importing Numpy

  17. 17

    Start automatically python webserver from visual studio code

  18. 18

    How to open Visual Studio Code from the command line on OSX?

  19. 19

    How to google from the context menu of the Visual Studio 2015 code editor

  20. 20

    How to install Visual Studio Code extensions from Command line

  21. 21

    How to open browser from Visual Studio Code API

  22. 22

    How to open Visual Studio Code (0.5.0 - 0.7.0) from Unity on OSX

  23. 23

    How to get the hex color code from a color dialog in visual studio?

  24. 24

    How to open project from source code in Visual Studio 2005

  25. 25

    How to COMPLETELY uninstall Visual Studio Code from Windows 10?

  26. 26

    How to prevent Visual Studio Code from opening files in the current tab?

  27. 27

    How to execute compiled python code

  28. 28

    How to execute compiled python code

  29. 29

    Running python script in Visual Studio Code; how to get `input ()` to work?

HotTag

Archive