Difference between revisions of "Await"

From wikieduonline
Jump to navigation Jump to search
Line 3: Line 3:
  
 
== In Python ==
 
== In Python ==
[[Python 3.5]] has added support for async/await as described in PEP 492 (https://www.python.org/dev/peps/pep-0492/).
+
Python 3.5 (2015)<ref>https://www.python.org/downloads/release/python-350/#:~:text=is%20available%20here.-,Python%203.5.,released%20on%20September%2013th%2C%202015.</ref> has added support for async/await as described in PEP 492 (https://www.python.org/dev/peps/pep-0492/).
  
 
<pre>
 
<pre>

Revision as of 11:24, 10 August 2021

wikipedia:Await


In Python

Python 3.5 (2015)[1] has added support for async/await as described in PEP 492 (https://www.python.org/dev/peps/pep-0492/).

import asyncio

async def main():
    print("hello")
    await asyncio.sleep(1)
    print("world")

asyncio.run(main())

See also

  • https://www.python.org/downloads/release/python-350/#:~:text=is%20available%20here.-,Python%203.5.,released%20on%20September%2013th%2C%202015.
  • Advertising: