擅长:python、mysql、java
<p>这不再是最新的jupyter版本中的问题!</p>
<p><a href="https://blog.jupyter.org/ipython-7-0-async-repl-a35ce050f7f7" rel="noreferrer">https://blog.jupyter.org/ipython-7-0-async-repl-a35ce050f7f7</a></p>
<p>只需编写一个异步函数,然后直接在jupyter单元中等待它。</p>
<pre><code>async def fn():
print('hello')
await asyncio.sleep(1)
print('world')
await fn()
</code></pre>