First time here? Check out the FAQ!

Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

answered 11 years ago

ndomes gravatar image

Let sage_eval evaluate in the namespace of the locals dictionary.

expr = sage_eval(xx,locals=locals())
click to hide/show revision 2
extended answer

Let sage_eval evaluate in the namespace of the locals dictionary.

expr = sage_eval(xx,locals=locals())

Or do you need something like this:

var_list =['a'+str(k) for k in (11..20)]
vars = dict([(v,var(v)) for v in var_list])
sage_eval('2*a11 +a14^a13-a12',locals=vars)