Tag Archives: gui

Pythonic UIs

I’ve just been reading Richard Jones’ current project, where he’s implementing a very Pythonic way of creating GUIs (for example, managing gui contexts using Python’s context managers). I’m very very excited, and I hope this sample code shows why:

with gui.form() as form: name = gui.row('Name', gui.text()) skill = gui.row('Skill level', gui.selection(['Awesome', 'Radical', 'Understated'])) @gui.submit('OK') def on_click(button): print 'Got name=%r'%name.value print 'Got skill=%r'%form['skill'].value gui.stop(0) @gui.cancel('Cancel') def on_click(button): gui.stop(1) 

Take a look at what this code does at Richard Jones’ weblog. It’s pretty awesome.