Skip main navigation

Common problem with VS Code

Learn about a very common annoyance when running Python code from VS Code.

In this video, you will learn about a very common annoyance when running Python code from VS Code. Were you able to guess what this problem could be in the previous step?

Watch this video to find out more.
The issue with running code in VS Code occurs when we switch from running lines of Python code to running an entire Python file or vice versa.
A suggested solution to this problem would be sticking to running only Python files, however, if you are new to Python, running lines of code to test them would be useful. For this purpose, the video explains how you could go about switching between the two.
As you get better, you will no longer need to run lines of code, and running entire Python files will be the optimal approach, especially when the code you are using becomes more complex.

Join the discussion

Take some time to explore this problem. If you are able to come up with a more efficient method of dealing with it, share the method with your peers.
Use the Comments section below and let us know your thoughts. Try to respond to at least one other post and once you are happy with your contribution, click the Mark as complete button to check the step off, then you can move to the next step.

This marks the end of the activity. In the next activity, we are going to start exploring different ways of running Python scripts.

This article is from the free online

Intermediate Python

Created by
FutureLearn - Learning For Life

Reach your personal and professional goals

Unlock access to hundreds of expert online courses and degrees from top universities and educators to gain accredited qualifications and professional CV-building certificates.

Join over 18 million learners to launch, switch or build upon your career, all at your own pace, across a wide range of topic areas.

Start Learning now