An extension for IPython that help to run AsyncIO code in your interactive session.
Project description
# asyncio-ipython-magic [![Requirements Status](https://requires.io/github/Gr1N/asyncio-ipython-magic/requirements.svg?branch=master)](https://requires.io/github/Gr1N/asyncio-ipython-magic/requirements/?branch=master) [![PyPI](https://img.shields.io/pypi/v/asyncio-ipython-magic.svg)](https://pypi.python.org/pypi/asyncio-ipython-magic) [![Supported Python versions](https://img.shields.io/pypi/pyversions/asyncio-ipython-magic.svg)](https://pypi.python.org/pypi/asyncio-ipython-magic)
An extension for [IPython](https://ipython.org) that help to run AsyncIO code in your interactive session.
Based on [Gist](https://gist.github.com/takluyver/b9663b08ac9a4472afa6).
## Installation
Install `asyncio-ipython-magic` using [pip](http://www.pip-installer.org/):
$ pip install asyncio-ipython-magic
...or directly from the repository using the `%install_ext` magic command:
$ In[1]: %install_ext https://raw.githubusercontent.com/Gr1N/asyncio-ipython-magic/master/asynciomagic.py
Enjoy!
## Usage
In [1]: %load_ext asynciomagic
In [2]: import asyncio
In [3]: import time
In [4]: async def foo():
...: i = 0
...: while i < 3:
...: print('time =', time.time())
...: i += 1
...: await asyncio.sleep(2)
...:
In [5]: %%asyncio
...: await foo()
...:
time = 1478985421.307329
time = 1478985423.309606
time = 1478985425.31514
In [6]:
## Testing
It just works, I hope.
## License
*asyncio-ipython-magic* is licensed under the MIT license. See the license file for details.
An extension for [IPython](https://ipython.org) that help to run AsyncIO code in your interactive session.
Based on [Gist](https://gist.github.com/takluyver/b9663b08ac9a4472afa6).
## Installation
Install `asyncio-ipython-magic` using [pip](http://www.pip-installer.org/):
$ pip install asyncio-ipython-magic
...or directly from the repository using the `%install_ext` magic command:
$ In[1]: %install_ext https://raw.githubusercontent.com/Gr1N/asyncio-ipython-magic/master/asynciomagic.py
Enjoy!
## Usage
In [1]: %load_ext asynciomagic
In [2]: import asyncio
In [3]: import time
In [4]: async def foo():
...: i = 0
...: while i < 3:
...: print('time =', time.time())
...: i += 1
...: await asyncio.sleep(2)
...:
In [5]: %%asyncio
...: await foo()
...:
time = 1478985421.307329
time = 1478985423.309606
time = 1478985425.31514
In [6]:
## Testing
It just works, I hope.
## License
*asyncio-ipython-magic* is licensed under the MIT license. See the license file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for asyncio-ipython-magic-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | da1d35e5aa1686fb96b6a64c9549eefe4e899531065ab0d1980ceaa6215979dc |
|
MD5 | d9f759c20c5e08c89ff587f656a6d92d |
|
BLAKE2b-256 | 352aff326ff5987b89a00339c7677b0cc16029eed7474c98c8af0951d28fc89a |
Close
Hashes for asyncio_ipython_magic-0.0.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 18c8cc320e17982a11611dfa00582bd0003df9e5adce9574a7d53773fbf6ea00 |
|
MD5 | 48716e4a3adc5177121903d1acf5d20d |
|
BLAKE2b-256 | 8a036ab5e5c010b58db7f32071b7421c7138663737c0973499fc75b1d7780b13 |