Skip to main content

Practice Python with colored grids in the IPython Notebook

Project description

Travis-CI Coveralls PyPI

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:

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:

Testing dependencies:

  • pytest >= 2.3, (for the test suite, see below)

  • responses >= 0.1

  • mock (dependency of responses)

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ipythonblocks-1.9.1.tar.gz (18.5 kB view details)

Uploaded Source

Built Distribution

ipythonblocks-1.9.1-py2.py3-none-any.whl (14.0 kB view details)

Uploaded Python 2 Python 3

File details

Details for the file ipythonblocks-1.9.1.tar.gz.

File metadata

  • Download URL: ipythonblocks-1.9.1.tar.gz
  • Upload date:
  • Size: 18.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for ipythonblocks-1.9.1.tar.gz
Algorithm Hash digest
SHA256 f1b2fbab0e96881a38e2b77b06619df783e5b5793353aaeefd705f2230c07d81
MD5 316ce2baa7f7d5ad185a60c1e5ce53d8
BLAKE2b-256 6518f02f0bf6000de495d70a5ff9165b90476c57384f27915244265126322c3e

See more details on using hashes here.

File details

Details for the file ipythonblocks-1.9.1-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for ipythonblocks-1.9.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 57af45dd6325a94c2762f9f3e7cac12a6457d3c60f6574fab7544991f1803e6c
MD5 be8e5c697bc86bb10c6ac90cfd08f056
BLAKE2b-256 6fb96147d443973c996f44ebac5a526e81ea38fc762696bbb2966aef6ec0007c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page