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.0.tar.gz (17.1 kB view details)

Uploaded Source

Built Distribution

ipythonblocks-1.9.0-py2.py3-none-any.whl (13.9 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: ipythonblocks-1.9.0.tar.gz
  • Upload date:
  • Size: 17.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

File hashes

Hashes for ipythonblocks-1.9.0.tar.gz
Algorithm Hash digest
SHA256 ba923cb7a003bddee755b5a7ac9e046ffc093a04b0bdede8a0a51ef900aed0ba
MD5 a811f12dcc273c7d8ee0f06d320b58a4
BLAKE2b-256 179ef7fa5821a47f47ab6aa3b546d46f577aceaea85b357d1da2f53c0c9c052f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ipythonblocks-1.9.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 13.9 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.7.3

File hashes

Hashes for ipythonblocks-1.9.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 111858436fdb28289fde627b5b7c4a448e84c1cf6ada6387941dc4cbb19f6616
MD5 157a38ef6b78fa7ca132729a1857fe8a
BLAKE2b-256 0a2e2ffc1f1f17fe48f98c9004b2612336384827b5c5889340027fd6046a7e7a

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