|
Project Information
Members
Featured
Downloads
Links
|
Overviewformlayout is a tiny Python module for creating form dialogs/widgets to edit various type of parameters with having to write any GUI code (it requires Python 2.x and PyQt4 4.y, with x >= 5 and y > 3). The main advantage of formlayout over similar libraries is that it's very simple to use/install and that it's so light (it just needs PyQt4 to run). However, if you are looking for more advanced automatic GUI generation, try the guidata library: this is an incredible combination of simplicity and power (and its compatible with PyQt4 and mostly with PySide too). Installationformlayout requires Python 2.x and PyQt4 4.y, with x >= 5 and y > 3:
Simple exampleThe main feature of formlayout is to provide the fedit function which transforms a list of parameters into a GUI-based form (you may also create a list of parameter lists - see formlayout.py for more advanced examples): from formlayout import fedit
datalist = [('Name', 'Paul'),
('Age', 30),
('Sex', [0, 'Male', 'Female']),
('Size', 12.1),
('Eyes', 'green'),
('Married', True),
]
print "result:", fedit(datalist, title="Describe yourself",
comment="This is just an <b>example</b>.")Here is the generated GUI dialog box:
And here is the result return by fedit: [u'Paul', 30, 'Male', 12.1, u'#008000', True] That's all! Advanced example: Pydeeformlayout is used in Pydee (project renamed to Spyder in 2009) to implement the matplotlib settings dialog box:
Integration in Pydee (http://code.google.com/p/pydee/):
|