from greenlet import greenletdef test1(): print("a") gr2.switch() print("b") gr2.switch()def test2(): print("c") gr1.switch() print("d")
gr1 = greenlet(test1)gr2=greenlet(test2)gr1.switch()