September Morn Update
This commit is contained in:
parent
4e2d22a71d
commit
aac6731f2c
6856 changed files with 141342 additions and 21127 deletions
|
|
@ -1,10 +1,15 @@
|
|||
Python 3.2 (r32:88445, Feb 20 2011, 21:30:00) [MSC v.1500 64 bit (AMD64)] on win 32
|
||||
Type "help", "copyright", "credits" or "license" for more information.
|
||||
>>> from concurrent import futures
|
||||
>>> with futures.ProcessPoolExecutor() as executor:
|
||||
... _ = list(executor.map(print, 'Enjoy Rosetta Code'.split()))
|
||||
...
|
||||
Enjoy
|
||||
Rosetta
|
||||
Code
|
||||
>>>
|
||||
import asyncio
|
||||
|
||||
|
||||
async def print_(string: str) -> None:
|
||||
print(string)
|
||||
|
||||
|
||||
async def main():
|
||||
strings = ['Enjoy', 'Rosetta', 'Code']
|
||||
coroutines = map(print_, strings)
|
||||
await asyncio.gather(*coroutines)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
asyncio.run(main())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue