Practice Python with colored grids in the IPython Notebook
ipythonblocks is a teaching tool for use with the IPython Notebook. It provides a BlockGrid object whose representation is an HTML table. Individual table cells are represented by Block objects that have .red, .green, and .blue attributes by which the color of that cell can be specified.
ipythonblocks allows students to experiment with Python flow control concepts and immediately see the effects of their code represented in a colorful, attractive way. BlockGrid objects can be indexed and sliced like 2D NumPy arrays making them good practice for learning how to access arrays.
See these demo notebooks for more on using ipythonblocks:
- Practicing with RGB
- Basic usage with explanations
- Fun examples
- Going from a JPEG to BlockGrid and text
- A programatic firework animation
- Using ipythonblocks.org
ipythonblocks can be installed with pip:
pip install ipythonblocks
However, the package is contained in a single .py file and if you prefer you can just grab ipythonblocks.py and copy it to wherever you want to use it (useful for packaging with other teaching materials).
- PIL (for starry_night_to_text.ipynb)
The test suite is written using pytest, so you can run the test suite with:
Release history Release notifications | RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size ipythonblocks-1.9.0-py2.py3-none-any.whl (13.9 kB)||File type Wheel||Python version py2.py3||Upload date||Hashes View|
|Filename, size ipythonblocks-1.9.0.tar.gz (17.1 kB)||File type Source||Python version None||Upload date||Hashes View|
Hashes for ipythonblocks-1.9.0-py2.py3-none-any.whl