Last active
November 23, 2021 20:09
-
-
Save nmchenry01/a5b61b0f386ff6031b6b3f51257158ce to your computer and use it in GitHub Desktop.
A second example of creating and printing a coroutine
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import asyncio | |
| async def something_async(): | |
| # Wait 3 seconds | |
| await asyncio.sleep(3) | |
| return "I'm async (sortof) now!" | |
| def main(): | |
| result = something_async() | |
| print(result) | |
| main() | |
| # Output: | |
| # | |
| # <coroutine object something_async at 0x7f775c1d51c0> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment