Python and XML

Lee Harr missive at frontiernet.net
Sun Aug 3 18:26:33 EDT 2003


In article <bgjh22$gun$1 at news-reader3.wanadoo.fr>, Matthieu M. wrote:
> Hi!
> 
> I want to make an application that needs to parse an xml file, but I 
> always have weird errors, I've got Python 2.3
> 
> Here's the beginning of my prog:
> 
> from xml.dom import pulldom
> 
> and here's python's answer:
> 
> Traceback (most recent call last):
>    File "xml.py", line 1, in ?
>      from xml.dom import pulldom
>    File "C:\progs\xml.py", line 1, in ?
>      from xml.dom import pulldom
> ImportError: No module named dom
> 
> When I look in my Python folder I see .py files in xml/dom...
> 
> Thanks for any help.
> 


I think the problem is that your program is called xml.py

so, when you say:

from xml import ....

it is trying to import from YOUR PROGRAM instead of the standard lib.
Try renaming your program.





More information about the Python-list mailing list