@@ -0,0 +1,942 @@
+%0Adef counter(start_at=0):%0A    count = start_at%0A    while 1:%0A        # other = yield foo,%0A        # when a value is sent to me,%0A        # set other to that value.%22%0A        # You can %22send%22 values to a generator using the generator's send method.%0A        print 'before yield count', count%0A        val = yield count%0A        print 'after yield val', val%0A        print 'after yield count', count%0A        if val is not None:%0A            count = val%0A        else:%0A            count += 1%0A%0Adef main1():%0A    c = counter(5)%0A    print '---one call---'%0A    print c.next()    #%0A    print '---one call---'%0A    print c.next()%0A    print '---one call---'%0A    # both sends a value to the generator and returns the value yielded by the generator%0A    # (mirroring how yield works from within the generator function%0A    print c.send(10)%0A    print '---one call---'%0A    print c.next()%0A    print c.send(None)%0A    print c.next()%0A%0Aif __name__ == '__main__':%0A    main1()

fix s