NEW: various python files

This commit is contained in:
xpk
2025-06-18 21:22:41 +08:00
parent 6c764730d3
commit 03797d6e8c
5 changed files with 135 additions and 9 deletions
+29
View File
@@ -0,0 +1,29 @@
#!/usr/bin/python3
"""
Documentation
Demonstrate how to use asyncio
License: This program is released under the MIT License
"""
# Imports
import asyncio
async def doit():
print('Start doing...')
await asyncio.sleep(2)
print('Done!')
# Main function
async def main() -> None:
print('Main starts...')
job_queue = []
for i in range(3):
job_queue.append(doit())
await asyncio.gather(*job_queue)
print('Main ends...')
# Call main function
if __name__ == '__main__':
asyncio.run(main())