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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 2 Python 3

File details

Details for the file twisted_ipython-2.0.0.tar.gz.

File metadata

  • Download URL: twisted_ipython-2.0.0.tar.gz
  • Upload date:
  • Size: 3.6 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.1 CPython/3.7.2

File hashes

Hashes for twisted_ipython-2.0.0.tar.gz
Algorithm Hash digest
SHA256 dfd4666a6b58851b311d2a92d058ea4b2ec0be34159296554ab59fcfa2d4d09a
MD5 1366b265ac92eee102afe3f11b0c69c5
BLAKE2b-256 61816197b561a772ef319284cdc718dbd9fbabf755d75668fff909e2e212f5f6

See more details on using hashes here.

File details

Details for the file twisted_ipython-2.0.0-py2.py3-none-any.whl.

File metadata

  • Download URL: twisted_ipython-2.0.0-py2.py3-none-any.whl
  • Upload date:
  • Size: 5.4 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.1 CPython/3.7.2

File hashes

Hashes for twisted_ipython-2.0.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 4a354f3965c63c6c797ab994422a1057ad7509f34581954b97cd8ac65071e2ec
MD5 3cf6d9c7aa2cf0b47c515fd5a784a1df
BLAKE2b-256 ff7747dc49ab95d5cc8cb37c150b0ead7ef00f2b967d40db9d22c40ac753ea7b

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