function namespaces

Darren Dale dd55 at cornell.edu
Tue Mar 8 20:06:52 EST 2005


> Generally, I avoid execfile within a function.  What's your use case?
> There may be a better way to approach this problem...

I am writing a simulation that loads some predefined constants, depending on
the options called by the user. I originally had it set up to parse the
file, and load the constants explicitly, but then I thought that with the
existence of this handy builtin execfile, I could make write my constants
file in python, and just load it. I guess it is not the best approach.
Thanks for the advice though (everyone), I learned something.




More information about the Python-list mailing list