ElementTree is the module containing ElementTree the class. I think
what you mean is

from elementtree.ElementTree import ElementTree
x=ElementTree()
x.parse('sample.xml')

Good luck,
Monty

On 8/3/06, Sridevi <[EMAIL PROTECTED]> wrote:
> I need to import ElementTree into IronPython
>
>  >>> from elementtree import ElementTree
>  >>> tree = ElementTree.parse('sample.xml')
>      Traceback (most recent call last):
>      File , line 0, in <stdin>##16
>      AttributeError: 'module' object has no attribute 'parse'
>
> The parse() is a funtion in element and it has to be called.
>
> 1 .
>  >>> import sys
>  >>> sys.path.append("c:\python24\Lib")
>
>  Here the elementtree folder is in the python library
>
> 2.
>  I copied the elementtree folder into the pyIron library.
>
> Both the methods give the same error.
>
> :) ... can u help me solve the problem
>
> Thanking you,
> Sridevi
>
> _______________________________________________
> users mailing list
> [email protected]
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
>
_______________________________________________
users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to