[sage-support] Re: Can you make @interact have a variable # of input boxes...

2009-01-22 Thread Luiz Felipe Martins
> > 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 > Th

[sage-support] Re: Can you make @interact have a variable # of input boxes...

2009-01-22 Thread Carl Witty
On Jan 22, 10:55 am, kcrisman wrote: > Luiz said: > > This worked for me, but it is definitely hackish and cumbersome. You > basically define the function in a string, exec the string to create > the function, and then use the function interact, instead using the > decoration @interact. (I've rea

[sage-support] Re: Can you make @interact have a variable # of input boxes...

2009-01-22 Thread kcrisman
Just passing this thread on to sage-support, since it more properly belongs there and some people there but not here might have comments. Also, is there any conceivable way that this sort of overloading could somehow automatically make it into the definition of how interact works, maybe via a key