You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

преди 1 година
12345678910111213
  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()