>
> I think it would be not too difficult to change @interact so that the
> following worked:
>
> fields = {'a': 10, 'b': 15, 'c': 31, 'd': 14, 'e': -5}
> @interact(fields)
> def _(**kwargs):
>    sum = 0
>    for fld_name in fields.iterkeys():
>        sum += kwargs[fld_name]
>    print sum
>

Thinking again, it could not be a dictionary, since then the order of
the controls might not be preserved. It would have to be a list of
pairs, for example.

-- 
"The main things which seem to me important on their own account, and
not merely as means to other things, are knowledge, art, instinctive
happiness, and relations of friendship or affection."
   -Bertrand Russell

L. Felipe Martins
Department of Mathematics
Cleveland State University
[email protected]

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to