This is a fork of AllenDowney/ThinkPython, adapted for use in a Python course. The online version of this fork is at https://y-rosenthal.github.io/yrThinkPython/.
The original book is Think Python: How to Think Like a Computer Scientist, 3rd edition, by Allen B. Downey. The original online version is at https://allendowney.github.io/ThinkPython/, and the home page for the book is at Green Tea Press. You can order print and electronic versions of Think Python 3e from Bookshop.org and Amazon.
Like the original, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
chapters/– the chapter notebooks (chap00.ipynb…chap19.ipynb). Edit these.blank/– "fill in the blanks" versions of each chapter with most code removed.solutions/– suggested solutions to the exercises (chapters 4 and 5 so far). Each file is a copy of the chapter notebook with the# Solution goes herecells filled in. The website shows these behind a collapsed "Suggested solution" dropdown under each exercise; the notebooks that Colab opens are unchanged.jb/– Jupyter Book configuration (_config.yml,_toc.yml), the landing pages (index.md,blank.md) andprep_notebooks.py, which strips%%expectmagics, adds section labels and merges in the solutions before the HTML build.thinkpython.py,diagram.py,structshape.py,words.txt,photos.zip– helper modules and data files used by the notebooks.
The site is built by the GitHub Actions workflow in .github/workflows/deploy-book.yml.
On every push to the v3 branch it copies the notebooks from chapters/ into jb/,
builds the HTML with Jupyter Book, and publishes the result to the gh-pages branch,
which GitHub Pages serves. The workflow can also be started by hand from the
repository's Actions tab.
To build locally:
pip install "jupyter-book<2"
cp chapters/chap[01][0-9].ipynb jb/
cd jb
python prep_notebooks.py
jb build .
# open _build/html/index.htmlThe upstream remote points at the original repository:
git fetch upstream
git merge upstream/v3