Created
March 2, 2019 20:28
-
-
Save mikeplavsky/3ca793afde9755373421d685ca07be5c 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
pong_c = None | |
ping_c = None | |
def ping(): | |
i = 0 | |
while True: | |
res = yield | |
print(res) | |
i += 1 | |
pong_c.send("ping") | |
def pong(): | |
i = 0 | |
while True: | |
res = yield | |
print(res) | |
i += 1 | |
ping_c.send("pong") | |
pong_c = pong() | |
ping_c = ping() | |
pong_c.send(None) | |
ping_c.send(None) | |
ping_c.send("start") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment