First time here? Check out the FAQ!

Ask Your Question
0

Does Sage have GUI capabilities?

asked 12 years ago

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.

Preview: (hide)

1 Answer

Sort by » oldest newest most voted
0

answered 12 years ago

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
Preview: (hide)
link

Comments

Thanks @ndomes.

SLOtoSF gravatar imageSLOtoSF ( 12 years ago )

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: 12 years ago

Seen: 622 times

Last updated: Dec 07 '12