Skip to content

Instantly share code, notes, and snippets.

View gvanrossum's full-sized avatar

Guido van Rossum gvanrossum

View GitHub Profile
import sys
import time
sys.setrecursionlimit(1200)
def g1(depth):
if depth > 0:
it = g1(depth-1)
yield next(it)
else:
import asyncio
END = b'Bye-bye!\n'
@asyncio.coroutine
def echo_client():
reader, writer = yield from asyncio.open_connection('localhost', 8000)
writer.write(b'Hello, world\n')
writer.write(b'What a fine day it is.\n')
writer.write(END)