Python for college and professionals

Advanced — stdlib, packaging, OOP tools, handover

Original RSIL closing course covering the remaining union: iterators and generators, stdlib (os, glob, argv, re, math, HTTP, dates, compression, pickle, XML, struct, logging, deque, weakref, templates), decimal and float limits, threads, venv/pip, unicode/bytes, operator overloading, properties, decorators, static/class/mixins, metaclasses, exception hierarchies, timeit/doctest, REPL next-steps, and a campus capstone.

Your progress (this browser)

0%

0 of 20 lessons complete

Level exam
  1. Lesson 1 · 50 min

    Iterators: next item please

    range already feels lazy. iter/next is the protocol. A 50,000-row log should not all sit in RAM because the kiosk wanted twenty lines.

    Start
  2. Lesson 2 · 50 min

    Generators: yield and generator expressions

    A function that yields the next row is a generator. A generator expression is a comprehension that does not build the whole list. Practise t

    Start
  3. Lesson 3 · 52 min

    os, glob, argv and process exit

    Does the data folder exist? Which CSV files match *.csv? What did the human type after python app.py? How do you exit with a non-zero status

    Start
  4. Lesson 4 · 50 min

    Patterns (re) and maths

    A 6-digit PIN is a pattern. A mean of lab readings is maths. re and math are stdlib. Validate at the edge; keep the core boring.

    Start
  5. Lesson 5 · 52 min

    HTTP, dates and compressed files

    A weather JSON body is labelled fields plus failure modes (timeout, 404). Dates need a timezone the college actually uses. zip/gzip are how

    Start
  6. Lesson 6 · 50 min

    pickle, XML and binary records

    pickle saves a Python object — do not unpickle a stranger’s file. XML is nested labelled text. struct packs bytes for a vendor device. JSON+

    Start
  7. Lesson 7 · 50 min

    Logging, deque, weakref and templates

    print is not a log. deque is a fast queue. weakref is ‘do not keep this object alive just because I cached it’. string.Template is a safer f

    Start
  8. Lesson 8 · 52 min

    Decimal, money and the float trap

    0.1 + 0.2 is a representation error, not a cashier total. decimal.Decimal or integer paise. This is the same topic as the language tutorial’

    Start
  9. Lesson 9 · 48 min

    Threads — and when not to use them

    Waiting on many HTTP calls is a maybe. One CPU-bound pandas groupby is a no. CPython’s GIL means threads often do not speed pure Python math

    Start
  10. Lesson 10 · 48 min

    Virtual environments and pip

    The college PC has one global Python. Your project gets a private toolbox. pip install into that toolbox, then pin versions.

    Start
  11. Lesson 11 · 52 min

    Unicode text vs bytes

    UTF-8 for student names. Bytes for JPEG and sockets. Opening a text file with the wrong encoding is how Indian names die. Source files are U

    Start
  12. Lesson 12 · 50 min

    Operator overloading without two formulas

    __add__ and __str__ are laptop syntax. The kiosk and the chart must still call one tested watts() or add_gst(). Overload by delegating to th

    Start
  13. Lesson 13 · 52 min

    Managed attributes: property, descriptor, getattr

    A setter that refuses negative seats is a property. Descriptors and __getattr__ are the heavier tools. Validate in one place so a form and a

    Start
  14. Lesson 14 · 52 min

    Decorators: wrappers you can see

    @timer is syntax for a function that calls another function. Class decorators wrap a whole type. If you cannot write wrap(fn), you are not r

    Start
  15. Lesson 15 · 52 min

    staticmethod, classmethod, mix-ins, factories

    A helper that needs no instance is static. A constructor alternative that needs the class is a classmethod. Mix-ins share a method across ty

    Start
  16. Lesson 16 · 48 min

    Metaclasses — usually not

    A class is an object whose type is type. A metaclass customises class creation. Internship code almost never needs one; a decorator or a fac

    Start
  17. Lesson 17 · 50 min

    Exception classes and catching policy

    except Exception swallows too much. except IndexError is precise. A campus error type (BadPin) lets callers catch your refusals without catc

    Start
  18. Lesson 18 · 50 min

    timeit, doctest and ‘batteries included’

    Measure before rewrite. doctest keeps examples in the docstring. The stdlib is large on purpose — look it up before you pip a one-liner.

    Start
  19. Lesson 19 · 46 min

    REPL editing, install notes, what next

    History and tab completion make the prompt usable. After this track: the library docs for the job you have (pandas, Flask, microcontroller).

    Start
  20. Lesson 20 · 55 min

    Capstone — a tool someone else can run

    Lab utilisation: percent, an 80% flag, two rooms, a print a technician can read, a test. README energy. That is handover — not FINAL3.ipynb.

    Start