# # Basic IO scheduler test -- cofunction version # from sys import stdin from cofunctions import * from scheduler import * @cofunction def loop(cocall): while 1: print("Waiting for input") yield cocall(block_for_reading, stdin) print("Input is ready") line = stdin.readline() print("Input was:", repr(line)) if not line: break coschedule(loop) run2()