Skip to main content

An IPython extension for running twisted code

Project description

twisted_ipython

An IPython extension that uses crochet to enable running Twisted in IPython and Jupyter notebooks.

The Short Short Version

Install this package into your Jupyter notebook's kernel. Then, load the extension:

%load_ext twisted_ipython

and then turn on autoawait for Twisted:

%autoawait twisted

and with a helper for the demo

from twisted.internet import reactor
from twisted.internet.defer import Deferred


def sleep(t):
    d = Deferred()
    reactor.callLater(t, d.callback, None)
    return d

we can now use async/await in cells like so:

print('Going to sleep...')

await sleep(1)

print('I HAVE AWAKENED!')

I Want To Know More!

Check out the much more complete README.ipynb!

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

twisted_ipython-2.0.0.tar.gz (3.6 kB view hashes)

Uploaded Source

Built Distribution

twisted_ipython-2.0.0-py2.py3-none-any.whl (5.4 kB view hashes)

Uploaded Python 2 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