Editor, terminal, Git, notebooks, and Python tooling — everything from Modules 2–6, in one window.
settings.jsonWhat an IDE is, why this one, and how to install it.
An Integrated Development Environment puts every tool a programmer needs in one place:
.ipynb files natively (Module 6)Spectrum: Notepad (just text) → VS Code (lightweight editor that grows into an IDE via extensions) → PyCharm / Visual Studio (heavyweight, all-in-one).
Learn one editor well. VS Code skills transfer to any language, any employer, any operating system.
VS Code ≠ Visual Studio. Visual Studio is a separate, much larger IDE mainly for C# and C++. We want Code.
winget install --id Microsoft.VisualStudioCode -e
…or download the User Installer from code.visualstudio.com (no admin needed). On the Additional Tasks screen, tick:
In a new terminal (PATH changed — Module 3!):
PS> code --version
1.104.2
...
PS> cd C:\actuarial_work\lapse_analytics
PS> code .
code . — “open this folder in VS Code” — is how you’ll start most sessions.
| 1 | Activity bar — switch views: Explorer, Search, Source Control, Run, Extensions |
| 2 | Side bar — the current view (here: your project’s files) |
| 3 | Editor — tabs of open files, side-by-side splits |
| 4 | Panel — Terminal, Problems, Output |
| 5 | Status bar — Git branch, Python version, errors |
| Ctrl+Shift+P | Command Palette — search every command |
| Ctrl+P | Quick-open a file by name |
| Ctrl+` | Show / hide the terminal |
| Ctrl+B | Show / hide the side bar |
| Ctrl+, | Settings |
| Ctrl+Shift+G | Source Control |
| Ctrl+Shift+X | Extensions |
| Ctrl+/ | Comment / uncomment lines |
| Alt+↑ / ↓ | Move line up / down |
| Ctrl+D | Select next match (multi-cursor) |
| F2 | Rename a variable everywhere |
| F12 | Go to definition |
Forgot a shortcut? Ctrl+Shift+P and type what you want. The palette shows the shortcut next to each command.
The first time you open a folder, VS Code asks whether you trust its authors. For your own projects: Yes, I trust the authors. For code downloaded from strangers, choose restricted mode.
Pushing and pulling still go through Git and Git Credential Manager (Module 5) — it may ask you to sign in once more.
The Settings UI, settings.json, and user vs. workspace scope.
settings.json — the text behind the form| Scope | File | Applies to |
|---|---|---|
| User | %APPDATA%\Code\User\settings.json | Every folder you open |
| Workspace | .vscode\settings.json inside the project | This project only — overrides User; commit it to share with your team |
settings.json{
"editor.fontSize": 15,
"editor.rulers": [88],
"files.autoSave": "onFocusChange",
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
"terminal.integrated.defaultProfile.windows": "PowerShell",
"[python]": {
"editor.defaultFormatter": "charliermarsh.ruff",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.organizeImports.ruff": "explicit"
}
},
"notebook.formatOnSave.enabled": true
}
rulers: a faint guide line at 88 characters (Ruff’s default width)autoSave: saves when you click away — no more unsaved-script surprisesdefaultProfile: terminals open PowerShell 7"[python]": settings for Python files only — format with Ruff and sort imports on saveJSON is strict: every entry except the last needs a comma, and keys need double quotes. VS Code underlines mistakes in red.
Modules 2 and 5, docked inside the editor.
cd’d into your project folderWith the Python extension installed, new terminals may auto-activate the project’s .venv — you’ll see (lapse-analytics) before the prompt. uv run works either way.
Just changed PATH or installed a tool? Opening a new terminal tab isn’t enough — VS Code copied the environment at start-up. Quit and restart VS Code.
| In VS Code (Ctrl+Shift+G) | Equivalent |
|---|---|
| “Changes” list | git status |
| Click a file → side-by-side view | git diff |
| + next to a file | git add file |
| ↶ Discard changes | git restore file |
| Message box + ✓ Commit | git commit -m |
| Sync / Publish Branch | git push / pull |
Because you learned the commands first, the buttons aren’t magic: each one is a Git command you already know.
Python, Jupyter, UV Toolkit, and Ruff.
Or from the terminal, by ID:
code --install-extension ms-python.python
code --list-extensions
Extensions run code on your machine with your permissions. Prefer verified publishers (blue tick) and well-known extensions; avoid look-alike names.
Too many extensions slow VS Code down. Install what you use; disable the rest per-workspace.
ms-python.python.venvms-toolsai.jupyter.ipynb files as native notebooksScripts: Ctrl+Shift+P → Python: Select Interpreter → choose .venv\Scripts\python.exe. The status bar then shows 3.12.x (.venv).
Notebooks: click Select Kernel (top right) → Python Environments → .venv. The kernel needs ipykernel, which jupyterlab already pulled in.
A community extension that brings uv into the editor:
pyproject.tomlInstall: Extensions view → search “UV Toolkit” → check the publisher → Install. Then type uv in the Command Palette to see what it offers.
Whatever buttons it adds, they run the same uv add, uv sync, uv run you learned in Module 4 — and they edit the same pyproject.toml and uv.lock.
Community extensions evolve quickly. If a feature moves or changes name, the terminal is always there as a fallback.
Ruff (by Astral, makers of uv) does two jobs, very fast:
Extension: charliermarsh.ruff. Squiggles appear as you type; formatting runs on save (with our settings.json).
# pyproject.toml — project-wide rules
[tool.ruff]
line-length = 88
[tool.ruff.lint]
select = ["E", "F", "I"] # style, bugs, imports
# Before saving
import pandas as pd, numpy as np
import os
rates={'yr1':0.12,'yr2' : 0.10}
def avg(x) : return sum(x)/len(x)
# After saving: imports sorted & split, code formatted.
# Ruff still underlines all 3 imports: F401 "imported but unused"
import os
import numpy as np
import pandas as pd
rates = {"yr1": 0.12, "yr2": 0.10}
def avg(x):
return sum(x) / len(x)
Also on the CLI: uv add --dev ruff, then uv run ruff check . and uv run ruff format .
lapse_analytics\
├── .vscode\
│ ├── settings.json workspace settings
│ └── extensions.json recommended extensions
├── pyproject.toml + [tool.ruff]
└── …
{
"recommendations": [
"ms-python.python",
"ms-toolsai.jupyter",
"charliermarsh.ruff"
]
}
.vscode\settings.json and extensions.jsoncode . gets a prompt: “Install recommended extensions?”pyproject.toml, everyone’s code is checked the same way — in the editor and on the CLISame idea as uv.lock for packages: make the environment reproducible, not just the code.
lapse_analytics with code ., trust it, and select the .venv interpretersettings.json, extensions.json, and Ruff ruleswinget install --id Microsoft.VisualStudioCode -e
# new terminal:
code --install-extension ms-python.python
code --install-extension ms-toolsai.jupyter
code --install-extension charliermarsh.ruff
# UV Toolkit: install from the Extensions view
cd C:\actuarial_work\lapse_analytics
uv add --dev ruff
code .
.venv"[python]" block from earlier.vscode\extensions.json with the three recommendations[tool.ruff] sections to pyproject.tomlcheck_env.py, add import os and squash some spacing: x=[1,2 ,3]os — read Ruff’s message. Check the Problems tab.uv run check_env.py in the terminal.notebooks\01_first_look.ipynb, pick the .venv kernel, Run All..vscode\* and pyproject.toml → commit “Add VS Code workspace config and Ruff rules”check_env.py → commit “Tidy check script with Ruff”check_env.py; then confirm with git log --oneline in the terminalcode . opens my project; I’m signed in with GitHubsettings.jsonPut every tool together — and get a first taste of Python, NumPy, pandas, and charts.