Practice Python with colored grids in the IPython Notebook
Project description
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
or easy_install:
easy_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)
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
File details
Details for the file ipythonblocks-1.6.1.zip
.
File metadata
- Download URL: ipythonblocks-1.6.1.zip
- Upload date:
- Size: 19.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 465eb8608d560bb410f79c88fab65c6f638ce2c2a86ba194d145e3e5d3a29831 |
|
MD5 | e9af55c0da8552658ffb67f93c9642f8 |
|
BLAKE2b-256 | 72c61f16b9263362bc166d296b8c214aeb6af558080febf40c7a8002cae93a6c |
File details
Details for the file ipythonblocks-1.6.1.tar.gz
.
File metadata
- Download URL: ipythonblocks-1.6.1.tar.gz
- Upload date:
- Size: 15.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca99af92f401682b3da6a8987fb74d251dcf3dd93ac85e05265b6ef5dd77bd64 |
|
MD5 | 4b2f65dff2bd2550c67b8fa1abe06c5b |
|
BLAKE2b-256 | b4a42e33d8acd14f91d4a6d5f965d96c02789e56adab8febac35cc4d1e312b1b |