En Thu, 12 Feb 2009 19:26:26 -0200, Hamish McKenzie <ham...@valvesoftware.com> escribió:

so I'm trying to wrap some functionality around execfile but don't want to modify the way it works. specifically when you call execfile, it automatically grabs globals and locals from the frame the execfile exists in.

so if I wrap execfile in a function, I need a way to reliably get at the calling frame.

Instead of doing that, just pass the desired namespaces to be used; you'll want to use locals() and globals() for that.

--
Gabriel Genellina

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to