Loading and executing an arbitrary Python script from within Python

Raymond Arthur St. Marie II of III rastm2 at aol.commorespam
Sun Jul 27 00:57:10 EDT 2003


>Dustin: shares his code with us:

>def run(self):
>        while self.threads:
>            for g in self.threads:
>                try:
>                    g.next()
>                except StopIteration:
>                    self.threads.remove(g)
>

Hi Dustin, 
I can't help, because I'm confused by 
this section of code. Particularly "g.next( )" 
in the try statement. 

Did I get the concept wrong about using
a generater in a try section? Is this code legal anyone?

Or does this only pertain to the yeild statement in a try.

Ray St.Marie
Rastm2 at aol.com






More information about the Python-list mailing list