xml - How to fix Python error importing ElementTree? -


i'm beginning learn python , here i'm trying read xml file using elementtree:

import sys elementtree.elementtree import elementtree  doc = elementtree(file="test.xml") doc.write(sys.stdout)   

however error: file "my_xml.py", line 2, in elementtree.elementtree import elementtree importerror: no module named elementtree.elementtree

i have lib files in /usr/lib/python2.6/xml/etree/... doing wrong?

thanks lot :)

it should be:

from xml.etree.elementtree import elementtree 

more information on can found @ python docs.


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

html - Instapaper-like algorithm -

c# - How to execute a particular part of code asynchronously in a class -