Hi,
In a .sage script, I can use load('f.sage') to load all the stuff from
f.sage. But all the functions and definitions in f.sage get put into the
same namespace as the script. I'd like to get the kind of namespace
behavior you get when using the regular Python "import".
That is, if f.sage contains a function foo(), I want to do
load_with_namespace('f.sage')
and then access foo() with f.foo(), just as if I did
import f
if "f" was a Python module.
(This just bit me: the parent script and the loaded script had variables
of the same name, and this caused confusing behavior when it should have
caused a "variable referenced before assignment" error.)
I think I can manually preparse the loaded .sage file and then import
that, but I'm wondering if there's a better way.
Thanks,
Dan
--
--- Dan Drake
----- www.math.wisc.edu/~ddrake/
-------
--
You received this message because you are subscribed to the Google Groups
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.
signature.asc
Description: Digital signature
