asyncio under Spyder

2,474 views
Skip to first unread message

Peter Vince

unread,
Dec 5, 2019, 3:20:17 PM12/5/19
to spyder
Running this code under Spyder:

async def main():
    print('Hello ...')
    await asyncio.sleep(1)
    print('... World!')

# Python 3.7+
print('go\n')
asyncio.run(main())

gives me:

RuntimeError: asyncio.run() cannot be called from a running event loop

Under IDLE or from the terminal, the code runs successfully.

Any thoughts?

Gregfx500

unread,
Dec 11, 2019, 5:13:01 PM12/11/19
to spyder
Reply all
Reply to author
Forward
0 new messages