Answers for "async command python"

1

async python

import asyncio

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

# Python 3.7+
asyncio.run(main())

# output
"""
Hello ...
...World!
"""
# with a 1 second wait time after Hello ...
Posted by: Guest on September-25-2021

Python Answers by Framework

Browse Popular Code Answers by Language