0
我正在嘗試用minidom將xml文件導入python。查找並導入xml文件到python
>>> from xml.dom import minidom
>>> import os
>>> xmldoc = minidom.parse('c/Users/WFD/Documents/VXWorks/XML_Parasing_Python')
和python找不到這個文件,即使我已經具體說明了它在哪裏。我是新來的python,所以如果有一個明顯的錯誤我道歉,但任何人都可以解釋如何導入mydocments中的XML文件? 這裏是錯誤:
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'
謝謝!