Cooperative multitasking and i/o for Python