Run Python File In Vscode Last Updated : 12 Apr, 2025 Summarize Comments Improve Suggest changes Share Like Article Like Report Visual Studio Code (VSCode) is a popular and versatile code editor that supports Python development with various features and extensions. In this article, we will see how to run Python files in VsCode.Below is the step-by-step procedure by which we can run the basic Python Script in VScode:Step 1: InstallationInstall the following libraries before starting.Install PythonInstall VScodeStep 2: Install Python ExtensionLaunch VSCode, go to the Extensions view (w can press Ctrl+Shift+X), and search for "Python." Install the one provided by Microsoft, which is the official Python extension.Step 3: Create a Python FileCreate a new Python file or open an existing one. For example, let's create a file named basic.py with the following content: Python print("Hello GeeksforGeeks") Output:Step 4: Select Python InterpreterIn the bottom-right corner of the VSCode window, click on the interpreter version (it might say "Select Python Interpreter"). Choose the Python interpreter you want to use for this project.Step 5: Run the Python File1. Using Right ClickRight-click on the editor or use the run button provided on thhe left corner of VScode to run the Python file. You should see the output in the terminal at the bottom of the VSCode window.2. Using Play ButtonWe can run our Python program inside the Python file using the Play button given on the right of the Visual Studio Code as given in the below picture.3. Using Specifying the Path in the TerminalWe can also run the Python file by specifying the path in the terminal as shown in the below picture.Specifying the Path to Run Python FileOutput in Terminal Comment More infoAdvertise with us Next Article How to Build Spring Boot Project in VSCode? R rahulsanketpal0431 Follow Improve Article Tags : Python Geeks Premier League Geeks Premier League 2023 Python Errors Practice Tags : python Similar Reads How to Format JSON in VSCode VSCode offers multiple ways to format JSON files, making it easy for developers to choose the method that best suits their workflow. A well-formatted JSON file is easier to read, understand, and debug, especially when working with complex data structures.Formatting JSON in VSCodeLet us see these way 2 min read How to Setup Rust in VSCode? Rust is a memory-safe compiled programming language that delivers high-level simplicity with low-level performance. It is popular for Building systems where performance is critical like games engines databases or operating systems and it is an excellent choice when targeting web assembly. It was sta 2 min read How to Install Golang in VScode? GO is a compiled programming language developed by Robert Griesemer, Rob Pike, and Ken Thompson at Google. It was introduced in 2009 and is also known as golang. In this article, we are going to see how you can set up Visual Code Studio for Go language Development. We are going to install the necess 3 min read How to Build Spring Boot Project in VSCode? Creating a Spring Boot project in Visual Studio Code (VS Code) streamlines the Java development experience. In this article, we'll explore the steps to set up and build a Spring Boot project in VS Code, ensuring a solid foundation to start developing robust applications. Step by Step process to the 3 min read How to configure VSCode for Ruby Developers? One can easily configure VSCode for Ruby with some steps mentioned below, but first, let's see what these terms are. Ruby is nothing but a high-level and general-purpose programming language. It was developed by Yukihiro Matsumoto in the mid-1990s. It is a simple language because its syntax is more 3 min read How to Install GitHub Copilot on VSCode? GitHub Copilot is a revolutionary AI-powered code completion tool developed by GitHub and OpenAI. It can help you write code faster and more efficiently by suggesting entire lines or blocks of code as you type. If you're using Visual Studio Code (VSCode), installing GitHub Copilot can significantly 4 min read Like