Welcome to Your Python Coding Journey!
Before diving into Python, installing a powerful code editor that will help you write and execute Python code efficiently is essential. Visual Studio Code (VS Code) is the ideal choice. It’s lightweight, versatile, and supports extensions for numerous languages, including Python. This section will teach you how to install VS Code on your Windows operating system.
Steps to Download and Set Up Visual Studio Code
Step 1: Download Visual Studio Code
1.1. Visit the Official Website:
Open your web browser and visit the official Visual Studio Code website: code.visualstudio.com.
1.2. Select Your Operating System:
On the homepage, you'll see download options for Windows, macOS, and Linux.
Click the appropriate button for your operating system to download the installer.
Step 2: Install Visual Studio Code
2.1. Locate the Downloaded File:
Once the download is complete, find the installer file in your downloads folder.
2.2. Run the Installer:
Double-click the installer to begin the installation process.
2.3. Accept the License Agreement:
When prompted, select "I accept the agreement" and click "Next."
2.4. Choose Installation Location:
You can keep the default location or select a different folder by clicking “Browse.” Once decided, click "Next."
3.1. Select Additional Tasks:
You’ll be given options to enhance your experience. Check the boxes for:
Check all the boxes
Click “Next” to proceed.
Step 3: Customize Your Setup
4.1. Sign in to Visual Studio Code Using GitHub:
If prompted, sign in to Visual Studio Code using your GitHub account to access extensions and collaboration tools.
If the extension doesn’t work, click the notification at the bottom right of the screen indicating the issue with GitHub sign-in.
If you click the option that indicates the download isn’t working, it will provide you with a URL and a security code.
4.2. Launch Visual Studio Code:
Once the installation is done, check the “Launch Visual Studio Code” option and click "Finish" to open the program.
Step 4: Set Up Visual Studio Code
Step 5: Create a Folder for Your Project
Step 6: Download and Install Python
5.1. Create a Folder for Your Project:
Click “< Get Started” to return to the setup wizard.
Click “Open a Folder” when prompted.
Right-click on a blank spot in your file explorer, and create a new folder called PythonApiProject (or any project name you prefer).
Select this new folder to start working on your first Python project.
Now that Visual Studio Code is ready, the next step is to install Python so you can start writing and running Python programs.
Download and Install Python
Now that Visual Studio Code is set up, the next step is to download and install Python. This will enable you to start writing and running Python code within VS Code. Follow these instructions to get Python up and running on your system.
Step 1 - Checking if Python is Already Installed
Before downloading Python, let’s check if it’s already on your computer. Follow these simple steps.
1.1. Open PowerShell
Press the Windows key on your keyboard or click the magnifying glass in the taskbar.
Type PowerShell and click Open.
1.2. Type Command
In the PowerShell window, type the following command:
Press Enter
python --version
1.3. Check the Result
If Python is installed, you’ll see the version number (e.g., Python 3.12.6).
If Python is not installed, you’ll see a message stating that Python wasn’t found, or an indication that it is not recognized.
Step 2 - Download Python
Follow these steps to download Python from the official website.
2.1. Visit Python’s Official Website:
Go to python.org.
2.2. Download the Latest Version
Hover over the Downloads tab at the top of the page.
Click the Download for Windows button (or your specific OS).
2.3. Save the Installer:
Wait for the download to complete.
Locate the installer file in your Downloads folder or the location where your browser saves downloaded files.
3.1. Run the Installer:
Locate the installer file you downloaded and double-click it.
Step 3: Install Python
3.2. Check ‘Add Python to PATH’:
On the setup screen, check the box labeled ‘Add Python to PATH’.
This allows you to run Python directly from the command line or PowerShell.
Start Coding in Python!
With Python and Visual Studio Code set up, you’re now ready to start coding in Python. Head back to Visual Studio Code, create a new Python file, and begin your journey!
3.3. Complete the Installation:
Click Install Now and follow the on-screen instructions to complete the installation.