#introtopython
9 posts tagged introtopython. All posts
Chapter 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.
Chapter 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.
Chapter 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.
Chapter 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.
Writing 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.
Chapter 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.
Chapter 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__.
Chapter 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.
Using 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)