QP School
Async/Await in Python 3 - Printable Version

+- QP School (https://qomplainerzschool.lima-city.de)
+-- Forum: Tutorials (https://qomplainerzschool.lima-city.de/forumdisplay.php?fid=3)
+--- Forum: Python 3 Tutorials and examples (https://qomplainerzschool.lima-city.de/forumdisplay.php?fid=51)
+--- Thread: Async/Await in Python 3 (/showthread.php?tid=5069)



Async/Await in Python 3 - Qomplainerz - 07-25-2023

import asyncio

async def async_example():
    print("Start")
    await asyncio.sleep(2)  # Asynchronous sleep for 2 seconds
    print("End")

# Create an event loop and run the async function
asyncio.run(async_example())