>
> 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
luizfelipe.mart...@gmail.com

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

Reply via email to