MCPcopy Create free account
hub / github.com/ZiniuLu/Python-100-Days / main

Function main

Day66-75/code/asyncio02.py:14–25  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

12
13
14def main():
15 loop = asyncio.get_event_loop()
16 urls = [
17 'https://www.baidu.com',
18 'http://www.sohu.com/',
19 'http://www.sina.com.cn/',
20 'https://www.taobao.com/',
21 'https://www.jd.com/'
22 ]
23 tasks = [download(url) for url in urls]
24 loop.run_until_complete(asyncio.wait(tasks))
25 loop.close()
26
27
28if __name__ == '__main__':

Callers 1

asyncio02.pyFile · 0.70

Calls 1

downloadFunction · 0.70

Tested by

no test coverage detected