Ask Your Question
0

Does Sage have GUI capabilities?

asked 2012-12-06 19:36:43 +0100

SLOtoSF gravatar image

I would like to be able to construct two sets of objects, and use the Sage Notebook display a list of the objects in each set (representing them with the __repr__ special method).

Let d = dict().

Then I would like to click on an object in one of the sets (say object a, click on an object in the other set, b), and those two clicks and a button click signifies d[a] = b.

I guess I am asking for a user-friendly way to do this.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2012-12-07 06:03:15 +0100

ndomes gravatar image

You can try interacts - if the buttons can display a proper representation of your objects.

L1 = ['dummy']+[0..15]
L2 = [None]+[x^2,sin(x),tan(x),log(x),sqrt(x),exp(x),'jam','foo']
D = {}
@interact(layout=[['key','value','auto_update']])
def _(key=L1,value=L2,auto_update=False):
    global D
    D[key] = value
    if D.has_key('dummy'): del(D['dummy'])   
    print D
edit flag offensive delete link more

Comments

Thanks @ndomes.

SLOtoSF gravatar imageSLOtoSF ( 2012-12-07 13:15:13 +0100 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2012-12-06 19:36:43 +0100

Seen: 583 times

Last updated: Dec 07 '12