Skip to content

Instantly share code, notes, and snippets.

@kunigami

kunigami/coroutine.py

Last active Jan 27, 2020
Embed
What would you like to do?
# Dummy function that prints what it receives
def echo():
print("initialized")
while True:
line = (yield)
print(line)
gen = echo()
gen.send(None)
gen.send("hello")
gen.send("world")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.