wikipedia pictures download example
This commit is contained in:
13
control/coro_demo.rst
Normal file
13
control/coro_demo.rst
Normal file
@@ -0,0 +1,13 @@
|
||||
>>> def coroutine():
|
||||
... print('coroutine started')
|
||||
... x = yield
|
||||
... print('coroutine received: {!r}'.format(x))
|
||||
...
|
||||
>>> coro = coroutine()
|
||||
>>> next(coro)
|
||||
coroutine started
|
||||
>>> coro.send(42)
|
||||
coroutine received: 42
|
||||
Traceback (most recent call last):
|
||||
...
|
||||
StopIteration
|
||||
Reference in New Issue
Block a user