Skip to content

Testing & Coding with Visual Studio Code

Remington Steed edited this page Sep 2, 2025 · 5 revisions

Overview

This guide helps you set up Visual Studio Code, Git, and a Python virtual environment on a Windows 10 laptop.

Visual Studio Code is a free Windows program that helps you work with a code project on your own computer. It includes great tools for viewing and editing code, along with tools for running and testing your changes without having to send them to GitHub and wait 5 minutes for a free server to run them (such as Render.com, which is what we use for this project). Once you've tested and perfected your code changes, VS Code also helps you commit your changes to GitHub so everyone can benefit from your brilliance.

Setting Up VS Code

  • Install VS Code from the Microsoft Store app on your Windows computer (search Visual Studio Code)
  • Install Python (newest version, currently 3.13) from MS store (search Python)
  • Check that Python is working: Open command prompt and type: python -3 --version
    • To find Command Prompt, search windows for "Command Prompt" or "cmd")
      Find Command Prompt on Windows
  • Create a workspace folder (I called mine "code" inside of my Documents folder), then open VS Code and open that folder
  • Install Python extension for Visual Studio Code
    VS Code extensions
  • Create a virtual environment: https://code.visualstudio.com/docs/python/python-tutorial#_create-a-virtual-environment
  • Connect GitHub: https://code.visualstudio.com/docs/sourcecontrol/github
    • Follow the detailed instructions below.
  • When you have Git working and are connected to GitHub, make a small change to your code, Run it, Test it
  • Commit when ready

1) Install Portable Git

  1. Download Portable Git for Windows (64-bit) from
    https://git-scm.com/download/win
    (look for a download like Git for Windows/x64 Portable)

    • Save that download to your Documents folder.
  2. Open File ExplorerDocuments.

  3. Run the PortableGit EXE file and extract PortableGit at Documents\PortableGit.
    After extraction you should see Documents\PortableGit\bin and Documents\PortableGit\cmd.

Add Git to PATH (one-time)

  1. Press Start (or the Windows button), type environment, open Edit the system environment variables.
  2. Click Environment Variables….
  3. Under User variables (top box), select PathEdit.
  4. Click New, then add:
    C:\Users\<YourName>OneDrive - KentDistrictLibrary\Documents\git\bin
    
  5. Click OK on all dialogs to save.
  6. Close and reopen VS Code/terminals so PATH updates.

Test Git:

git --version

2) Set Up VS Code for GitHub

  1. Open VS Code.
  2. Install the GitHub Pull Requests and Issues extension (on the Extensions tab on the left sidebar).
  3. Close and reopen VS Code.

3) Connect to GitHub

  1. Open the Source Control panel.
  2. Click Publish to GitHub (or Sign in to GitHub if prompted).
  3. A Windows browser/login popup may appear—sign in and approve access.
    (You might see this again when cloning.)

4) Clone the Repository

  1. In VS Code, run Clone Repository.
  2. When prompted, open it in a new workspace.

    Heads up: Don’t add it to an existing workspace that already has a venv—that can break your environment.


5) Open the Project

  • Open the project’s README.md in VS Code to confirm it loaded.

6) Set Up Your Python Virtual Environment

  1. Create a virtual environment (using the VS Code console):
    python -m venv venv
  2. Activate it:
    ./venv/Scripts/activate
  3. Install dependencies:
    pip install -r requirements.txt

Optional (recommended): ensure venv/ is in .gitignore:

venv/

Suggested Process for Code Changes

  • Code with a partner
  • Define the change you want to make (or the new project you want to create)
  • What is "version 1" of that idea? Define the next step forward, not the finished product.
  • Ask a chatbot for that next step, and feed in any code you already have.
  • Chatbot gives you code
  • First, try reading that code. Can you tell what changed? What do you think it does?
  • Try testing/running that code. Any errors? Did it work as you expected?
  • Before jumping to more changes, use the chatbot to help you understand. Add code comments. Explain lines you don't understand. Ask it for alternatives (to a function or the structure of the entire thing) and for pros and cons to each.