import random
import asyncio async def random_number_gen(delay, start, end):
while True:
yield random.randint(start, end)
await asyncio.sleep(delay) async def main():
async for i in random_number_gen(1, 0, 100):
print(i) try:
print("Starting to print out random numbers...")
print("Shut down the application with Ctrl+C")
asyncio.run(main())
except KeyboardInterrupt:
print("Closed the main loop..")

最新文章

  1. Vim命令合集大全
  2. web移动端资源整(1)
  3. WPF触发器的使用
  4. SAP的运输功能(转)
  5. springMvc源码学习之:spirngMvc获取请求参数的方法
  6. SQL Server 的事务和锁(一)
  7. HTML 之 Embed兼容问题
  8. Review PHP设计模式之——单例模式
  9. Android开发之屏幕方向
  10. js编译和执行顺序
  11. ural 1294 Mars Satellites
  12. [原]此程序专用来说明C++模板的用法
  13. weblogic 部署问题定位与解决
  14. EventBus猜想 ----手把手带你自己实现一个EventBus
  15. 为Android添加JNI支持
  16. BZOJ4589 Hard Nim(快速沃尔什变换模板)
  17. SpringBoot实战一:发送邮件
  18. Codeforces 359E Neatness
  19. 20190312 Windows安装Kafka
  20. Hibernate添加日志--log4j

热门文章

  1. [NOIP10.4模拟赛]2.y题解--折半搜索+状压计数
  2. 关于SpringMVC的几件小事
  3. 可运行jar包转.exe
  4. HTML Ueditor图片宽度超出编辑器
  5. python3学习特性
  6. CDH5.16.1的agent启动报错:ERROR Error, CM server guid updated, expected d9bcadb4-f983-41b8-a667-66760f47bc91, received a67f5efa-8473-4f6a-94d6-231d1f432ef0
  7. linux——常用命令
  8. Comparator分组测试
  9. Python正则及geometer正则截图讲解
  10. Linux一些常用的命令