Traits——信息输入界面
from traits.api import HasTraits, Str, Int from traitsui.api import View, Item, Group class Simple(HasTraits): first_name = Str last_name = Str department = Str employee_number = Str salary = Str bonus = Int view1= View( Group( Item(name = "employee_number", label=u"编号"), Item(name = 'department',label=u"部门",tooltip=u"在哪个部门干活"), Item(name = "last_name",label=u'姓'), Item(name = 'first_name',label=u'名'), label = u"个人信息", show_border = True ), Group( Item(name = 'salary',label=u'工资'), Item(name = 'bonus',label=u"奖金"), label=u'收入', show_border = True ) ) sam = Simple() sam.configure_traits(view=view1)