From 830b0398b556a341272b7925c6332398d0bdb935 Mon Sep 17 00:00:00 2001 From: Zhenyu-Yuan <39400483+Zhenyu-Yuan@users.noreply.github.com> Date: Sat, 12 Dec 2020 15:23:19 +0800 Subject: [PATCH] Update spinner_asyncio.py In Jupyter I can run this correctly only after these modifications. --- 18-asyncio-py3.7/spinner_asyncio.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/18-asyncio-py3.7/spinner_asyncio.py b/18-asyncio-py3.7/spinner_asyncio.py index 369a8f0..ccb1bf7 100755 --- a/18-asyncio-py3.7/spinner_asyncio.py +++ b/18-asyncio-py3.7/spinner_asyncio.py @@ -36,11 +36,11 @@ async def supervisor(): # <6> return result -def main(): - result = asyncio.run(supervisor()) # <11> +async def main(): + result = await supervisor() # <11> print('Answer:', result) if __name__ == '__main__': - main() + await main() # END SPINNER_ASYNCIO
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies: