Reinitializing the python interpreter form Java

Andre M. Descombes amdescombes at diligo.fr
Wed May 30 03:55:17 EDT 2001


Ok, good Idea, but what will happen to the variables I pass that way, will
they be still accessible from another function that I call? they shouldn't
be there at all anymore, they should go out of scope as soon as I exit the
function.

Thanks again Ype,

Andre

"Ype Kingma" <ykingma at accessforall.nl> wrote in message
news:3B13F8EF.A865F50E at accessforall.nl...
>
> For a second I was afraid this comes in the category
> "you can't have your cake and eat it".
>
> But you have control over the locals/globals so you could easily
> pass something using PyInterpreter.set(), or just do it directly:
>
> theLatestCopyOfYourGlobals['varName'] = valueYouWantToPass
>
> before doing the exec. Using varName in your function should do the trick
then.
>
> Have fun,
> Ype





More information about the Python-list mailing list