Last active
January 27, 2020 07:07
-
-
Save kunigami/061aeb10dc2c2774dc16c3ca31dbcef4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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