finding and Importing xml file into python
I am attempting to import an xml file into python with minidom.
>>> from xml.dom import minidom
>>> import os
>>> xmldoc =
minidom.parse('c/Users/WFD/Documents/VXWorks/XML_Parasing_Python')
and python cannot find this file even though I have specifically spelled
out where it is. I am new to python so if there is a glaring error I
apologize but can anyone explain how to import an xml file in mydocments?
Here is the error:
Traceback (most recent call last):
File "<pyshell#3>", line 1, in <module>
xmldoc =
minidom.parse('c/Users/WFD/Documents/VXWorks/XML_Parasing_Python')
File "C:\Python27\lib\xml\dom\minidom.py", line 1920, in parse
return expatbuilder.parse(file)
File "C:\Python27\lib\xml\dom\expatbuilder.py", line 922, in parse
fp = open(file, 'rb')
IOError: [Errno 2] No such file or directory:
'c/Users/WFD/Documents/VXWorks/XML_Parasing_Python'
Thanks!
No comments:
Post a Comment