Logo

4,222 Introduction to Programming

Lecture 2: Summary

Dr. Aurélien Sallin

2026-02-27

The Terminal

  • A text-based interface to interact with your computer
  • Mac uses bash (Terminal), Windows uses Command Prompt or PowerShell. In this course, we focus on bash and command prompt commands.
  • All commands operate relative to your current working directory. Always know where you are!
  • Paths: absolute (C:/Users/Bilbo/Documents/) vs relative (../Documents/)

The Terminal

Action bash (Mac) Command Prompt (Windows)
Show current directory pwd cd (without arguments)
List files ls dir
Navigate cd <path> cd <path>
Create directory mkdir mkdir
Write text to file echo “text” > file echo text > file
Home shortcut ~ (e.g. cd ~/Documents) -
Current directory shortcut . .
Parent directory shortcut .. ..

Using Visual Code

The IDE

  • VS Code is our IDE: code editor + terminal + extensions in one tool
  • Always open VS Code from your project directory (code .)
  • Install extensions: Python, Pylance, Ruff, Jupyter

Python & Environments

Why Python?

  • Readable, versatile, widely used in data science, economics, and AI
  • Coming from R: watch out for 0-based indexing and indentation

Python & Environments

Virtual Environments with uv

  • Each project gets its own isolated environment (its own “kitchen”)
  • Never install packages globally, always use environments!
  • Key commands:
uv init –python 3.14.1 Create a new project
uv add pandas numpy Add packages
uv run main.py Run a script in the environment
uv sync Install dependencies from lock file
  • Key files: .python-version, pyproject.toml, uv.lock, .venv/