Skip to Content

Setting up and your first program

Install

  • Windows/macOS: python.org installer (tick "Add Python to PATH" on Windows), then install VS Code with the Python extension.
  • Linux: sudo apt install python3 python3-venv python3-pip.

Check: python3 --version.

Your first program

name = input("What is your name? ")
print(f"Hello, {name}! Welcome to Python.")

Save as hello.py, run with python3 hello.py.

Virtual environments — do this from day one

python3 -m venv .venv
source .venv/bin/activate      # Windows: .venv\Scripts\activate
pip install requests openpyxl

Each project gets its own isolated packages, so upgrading one never breaks another.

Rating
0 0

There are no comments for now.

to be the first to leave a comment.