Skip to content

#introtopython

9 posts tagged introtopython. All posts

  1. PythonChapter 10: Introduction to data science in PythonWhat data science is, how it differs from data analytics, and three starter examples using matplotlib, pandas, and requests.
  2. PythonChapter 7: Reading, writing and processing files in PythonOpening files with open() and with, file modes, processing lines with string methods and regex, CSV/JSON/XML modules, large files, and running ffmpeg.
  3. PythonChapter 8: Functional programming in PythonChapter 8 of my intro to Python book covers pure functions, map, filter, reduce, lambdas, comprehensions and generators, with runnable examples.
  4. PythonChapter 9: Web development with Python and FlaskChapter 9 of my intro to Python book covers HTTP, HTML, CSS and JavaScript basics, Python web frameworks, a small Flask app with a form, and running it in Docker.
  5. PythonWriting generator functions with yield in PythonHow the yield keyword turns a function into a generator, how to consume one with a for loop or next(), and when generators save memory.
  6. PythonChapter 4: Python modules, packages and pipHow to import modules, use the standard library, write your own modules and packages, and install third-party packages with pip.
  7. PythonChapter 5: Classes and objects in PythonHow to define a Python class, create objects from it, use self and __init__, access attributes and methods, and give objects a readable __str__.
  8. PythonChapter 6: Handling and raising exceptions in PythonHow Python exceptions work, catching them with try/except/else/finally, raising your own with raise and assert, and defining custom exception classes.
  9. PythonUsing IPython as a calculator to work out progressive income taxUse the IPython shell for quick arithmetic, then write a small function that calculates tax across progressive brackets and check the result.

© 2026 David Li · Home · Blog · RSS ·Classic site · Built with Astro, Starlight and three.js · Logos:Font Awesome Free (CC BY 4.0)