+
Skip to content

jrycw/jrycw

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 

Repository files navigation

Hi there 👋

import asyncio
import random
from itertools import count

cnt = count()
whoami = ["Simulation Engineer", "Python Developer", "Rust Enthusiast"]


async def describe(sth: str) -> str:
    await asyncio.sleep(random.random() / 10)
    print(sth)
    return sth


async def _main() -> None:
    print(f"Cycle {next(cnt)}: ")
    descriptions = [describe(me) for me in whoami]
    tasks = [asyncio.create_task(description) for description in descriptions]
    await asyncio.gather(*tasks)
    print()


async def main() -> None:
    while True:
        await _main()


if __name__ == "__main__":
    asyncio.run(main())
Cycle 0:
Simulation Engineer
Python Developer
Rust Enthusiast

Cycle 1:
Rust Enthusiast
Simulation Engineer
Python Developer

Cycle 2:
Python Developer
Rust Enthusiast
Simulation Engineer
...

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载