pyqt - How do i display the data contents of my xml file using pyqt4? -


i trying build tiny app read xml file , display on widget. don't know widget use exactly; qtextbrowser, qtextedit , qwebview. can't seem find explanation. please as can. before get, i'm new python, pyqt , programming ain't @ all.

i suggest first interprete xml content dom object, , show whatever want object widget. first part (detailed info here):

from xml.dom import minidom dom = minidom.parse('my_xml.xml') print(dom.toxml()) # .toxml() creates string dom object  def print_some_info(node):     print('node representation: {0}'.format(node))     print('.nodename: ' + node.nodename)     print('.nodevalue: {0}'.format(node.nodevalue))     child in node.childnodes:         print_some_info(child)  print_some_info(child) 

(using e.g. xml example in file 'my_xml.xml' here)


Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -