Generic·How-To

Setting Up VSCode with Python & Git: A Complete Guide

A step-by-step guide to installing VSCode, configuring Python, and setting up Git for your software engineering projects.


1. Problem Statement

Before you can start writing and managing code effectively, you need a robust local development environment. Writing code in basic text editors and manually zipping files to share them leads to disorganized, error-prone workflows. The problem is creating a streamlined, professional environment for writing, running, and version-controlling code on your own machine.

2. Why this has been invented

Integrated Development Environments (IDEs) like VSCode were invented to bring syntax highlighting, debugging, and terminal access into a single application. Version control systems like Git were invented to solve the problem of tracking changes over time, collaborating with others without overwriting their work, and easily reverting to older versions of your code when something breaks.

3. Technical Details

Follow these steps to set up a professional engineering workspace on your local machine:

Step 1: Install Visual Studio Code

  • Download the installer from the official VSCode website.
  • Run the installer and follow the default prompts.
  • Once installed, open VSCode and navigate to the Extensions view (Ctrl+Shift+X or Cmd+Shift+X).
  • Search for “Python” (by Microsoft) and install the extension for rich support including IntelliSense, linting, and debugging.

Step 2: Install Python

  • Go to the Python downloads page.
  • Download the latest stable version for your operating system.
  • Crucial step for Windows users: During installation, check the box that says “Add Python to PATH” before clicking “Install Now”.
  • Verify the installation by opening a terminal (or command prompt) and running python --version (or python3 --version on macOS/Linux).

Step 3: Install and Configure Git

  • Download Git from git-scm.com and run the installer.
  • Open your terminal and configure your identity, which will be attached to your commits:
  • Run: git config --global user.name "Your Name"
  • Run: git config --global user.email "your.email@example.com"
  • Verify Git is installed by running git --version in your terminal.

Step 4: Create Your First Project

  • In VSCode, go to File > Open Folder and create a new folder for your project.
  • Open the integrated terminal in VSCode (Terminal > New Terminal).
  • Initialize a new Git repository by typing: git init
  • Create a new file named main.py and add a simple Python script: print("Hello, Engineering World!")
  • Run the script in the terminal with: python main.py

4. Summary

By setting up VSCode, Python, and Git, you have equipped yourself with the standard tools used by software and data engineers worldwide. This environment allows you to write intelligent code, execute it locally, and safely track every change you make.

Chat with us