NLP Lab — Python Master Guide

Explains each Python lesson file + previews code + embedded Pyodide editor

How to use this page For VS Code students

Save this file inside nlp-lab/python/ as MASTER.html. Students can read explanations, click a file, preview code, and also run Python in the embedded editor (internet required).

Best way (recommended): open this page via a local server.
• VS Code extension: Live Server → right click MASTER.html → “Open with Live Server”
OR run: py -m http.server 5501 (Windows) / python3 -m http.server 5501 (Mac/Linux)
Then open: http://localhost:5501/MASTER.html
Note: If you open this file by double-clicking (file://), the code preview may be blocked by the browser. Use Live Server / localhost for smooth preview.

Python lessons (click to preview)

Click any file to see its goal, what it teaches, run command, and its full code.

Run instructions (students)

  • Create venv: py -m venv .venv (Windows) / python3 -m venv .venv
  • Activate: .venv\Scripts\activate (Windows) / source .venv/bin/activate
  • Install: pip install -r requirements.txt
  • Run: python 06_cosine_similarity.py
Class tip: After selecting a file here, click Copy Code → paste into the Pyodide editor (right) to run instantly.
Select a file on the left.

No file selected

Click a file name on the left to load its explanation and code preview.

Embedded Pyodide Editor Internet required

This lets students run the same Python snippets in-browser. For serious work, they should still run scripts in VS Code terminal.

Workflow: 1) Select a file on left → 2) Click Copy Code → 3) Paste in editor and Run → 4) Then run the same file in VS Code terminal
Note: If the embedded editor refuses to load inside an iframe due to site headers, open it directly in a new tab: https://www.learnwithchampak.live/2026/01/programmers-picnic-python-editor.html