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:
Basic usage with explanations
Going from a JPEG to BlockGrid and text
A programatic firework animation
Install
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).
Dependencies
Required dependencies:
Optional dependencies:
requests >= 1.0 (for posting and getting to/from ipythonblocks.org)
Pillow (for creating images)
Testing dependencies:
Demo dependencies:
PIL (for starry_night_to_text.ipynb)
Testing
The test suite is written using pytest, so you can run the test suite with:
py.test
Release files for ipythonblocks 1.9.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ipythonblocks-1.9.1.tar.gz | 18.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ipythonblocks-1.9.1-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 32.5 kB
Release files / ipythonblocks-1.9.1.tar.gz
| Download URL | ipythonblocks-1.9.1.tar.gz |
|---|---|
| Size | 18.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f1b2fbab0e96881a38e2b77b06619df783e5b5793353aaeefd705f2230c07d81
|
|
BLAKE2b-256 checksum How to use checksums |
6518f02f0bf6000de495d70a5ff9165b90476c57384f27915244265126322c3e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|
Release files / ipythonblocks-1.9.1-py2.py3-none-any.whl
| Download URL | ipythonblocks-1.9.1-py2.py3-none-any.whl |
|---|---|
| Size | 14.0 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
57af45dd6325a94c2762f9f3e7cac12a6457d3c60f6574fab7544991f1803e6c
|
|
BLAKE2b-256 checksum How to use checksums |
6fb96147d443973c996f44ebac5a526e81ea38fc762696bbb2966aef6ec0007c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.6
|