Perhaps but the fact is that I need to execute code from some files in the filesystem and I need to have a common stack for them<br><br>2 questions came to my mind:<br><br>1.- How can I execute code from files in the filesystem? (I choose exec for that)<br>
2.- If exec is my only option: how can I use a common stack for them?<br><br>Thanks<br><br><div class="gmail_quote">2009/10/28 Dave Angel <span dir="ltr"><<a href="mailto:davea@ieee.org">davea@ieee.org</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">Garito wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi!<br>
I'm trying to use exec in a recursive way but I have a problem<br>
<br>
When I read the manual I understand that the globals and the locals are<br>
passed by reference but if I try to use it in a recursive way the new values<br>
added in a step are not passed to the next one<br>
<br>
Could someone point me how to do that?<br>
<br>
Thanks<br>
<br>
<br>
</blockquote></div>
see <br>
<a href="http://www.catb.org/%7Eesr/faqs/smart-questions.html" target="_blank">http://www.catb.org/~esr/faqs/smart-questions.html</a><br>
<br>
Post some sample code, and show what doesn't work; maybe you'll get some help that way.<br>
<br>
I'll point out just one thing: you cannot add new local variables at runtime. locals() should be used to inspect, not to modify.<br>
<br>
See the help text:<br>
"The contents of this dictionary should not be modified; changes may not affect the values of local variables used by the interpreter"<br>
<br>
I have no idea if exec() can be safely called recursively. Most people successfully avoid calling it at all.<br>
<br>
DaveA<br>
<br>
<br>
</blockquote></div><br><br clear="all"><br>-- <br>Mi twitter: <a href="http://twitter.com/garito">http://twitter.com/garito</a><br>