Skip to main content

Jupyter-like cell running in ipython

Project description

# ipython-cells

This repo contains the codes for bringing Jupyter-like cell functionality to ipython.

## Example

Suppose we have a .py file with cells separated by user created comments

`example.py`

``` python
# %% cell1
a = 10

# %% cell2
a += 1
print(a)
```

In ipython:

``` python

# load the extension
%run ipython_cells.py

# load example.py with autoreloading enabled
%load_file example.py --autoreload

# simple cell running
%cell_run cell1
%cell_run cell2
11
%cell_run cell2
11

# override variables
%cell_run cell2 a=100
101

# example.py is modified by an external editor (e.g. `a += 1` -> `a += 2`)
# we detect that and automatically reload the cells
%cell_run cell2
103
```


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

ipython_cells-1.0.tar.gz (2.7 kB view hashes)

Uploaded Source

Built Distribution

ipython_cells-1.0-py3-none-any.whl (3.3 kB view hashes)

Uploaded Python 3

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