import xml.etree.ElementTree as ET
tree = ET.parse('mesa1.glade')
entry = ET.Element('property')
entry.attrib = {'name': 'has_entry'}
entry.text = "True"
for e in tree.iter():
if 'class' in e.attrib and e.attrib['class'] == "GtkComboBoxEntry":
e.append(entry)
tree.write(open('out.xml', 'wb'))
pncconf 需要更新到 GTK3 才能与 python3 一起使用。