Re Iptscrae Python and While
Terry Reedy
tjreedy at udel.edu
Wed Feb 25 23:00:12 EST 2004
"Bluexcell" <bluexcell at aol.com> wrote in message
news:20040225180158.08854.00000402 at mb-m13.aol.com...
> What i want is a loop in which the the cycle rate is a variable, so it
can be
> controlled globally from other functions, I also need to set a variable
to
> start and stop the loop so i can call it and set it globally from other
> functions and i can see that is possible, by containing the While loop
in a
> function.
I do not quite understand what you want to do. However, when a while loop
inside a function contains a yield statement, then cycling is controlled by
calling .next on the resulting gen-iterator. This can be done from
multiple places, by any function with a reference to the iterator. Hope
this at least gives you more ideas.
Terry J. Reedy
More information about the Python-list
mailing list