您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

13 行
299B

  1. import asyncio
  2. @asyncio.coroutine
  3. def test(i):
  4. print('test_1', i)
  5. r = yield from asyncio.sleep(1)
  6. print('test_2', i)
  7. if __name__ == '__main__':
  8. loop = asyncio.get_event_loop()
  9. tasks = [test(i) for i in range(3)]
  10. loop.run_until_complete(asyncio.wait(tasks))
  11. loop.close()