Understand how to execute individual lines of Python code directly from within the editor. This can help facilitate iterative testing.
- [Instructor] Earlier in the course, … we saw a simple example of how to execute … a line of Python code in the interpreter … using Shift + Enter … Let's take a closer look at that feature now … which used the Python extensions R E P L or REPL feature. … So REPL stands for Read Evaluate Print Loop, … it's an interactive form of working with Python … that you can perform directly within .vscode … So let's open up a sample file here … and it's called Test REPL, and to start the interpreter, … first I'll select these few lines here … so I import the math module and then calculate, … well I don't really calculate anything, … I'm just going to print out the value of pi. … So I'm going to type Shift + Enter … and you can see that when I do that, … that starts the interpreter in the terminal … and you can see that each of the lines of codes … is being run in the interpreter … and then there's the result right there. … Now sometimes I found that .vscode will send … the initial lines of code before …
Released
5/13/2019- Constructing a simple Python program in VS Code
- Editing, formatting, and refactoring Python code
- Debugging Python code
- Setting breakpoints
- Using Python docstring
- Creating better comments for your source code
- Using the REST Client extension
Share this video
Embed this video
Video: Using the Python REPL